Since passenger lists on flights around the world are pretty much public information, the US immigration services will know exactly where you have visited in the past, and could totally put you in prison for lying when answering the question.
Is that something only people on ESTA get asked? Never heard of people on visas being asked that.
But as a US citizen you will never be asked. And better yet if you are a dual citizen like me. Then you can travel on your other passport to the places the US finds to be undesirable.
The US specifically asks you if you have travelled to those countries. You can either lie, and that’s a serious risk at being jailed, deported, banned from ever going again, and having issues going to other countries, or you can tell the truth.
I am quite sure that this is not true.