As others have said, when passing though a community ASK the police where a good place to camp is.
If they are negative types, keep on peddling.
Oh, I don't wait until dusk to begin looking for somewhere to sleep.
In those cases, I "dive in". That is I find a wooded areas about 100 yrds off the road and disappear into that area.
Note, that I have had to do this only a couple of times in 20 + years of bike touring in the USA.
I have slept in peoples front yards, on picnic benches in front of resturants, community parks, county parks and state and federal parks.
I like the state and federal parks because they usually have showers.
Note that many states have laws about bike tourists. That is, a state park cannot turn you away - even if they are full. The private campgrounds can.
When I camp, I make certain that there is no evidence of my being there. I even clean up a larger area than I used.
I carry plastic bags to haul the stuff out.