All land is owned by someone or some governmental body. It is best to do some research FIRST. You can contact the county records department for names/addresses of owners. Then you should contact them for permission. If state or county owned, you should check with the county sheriff or city police for any ordinances or laws that prohibit or permit access and detecting. For federal government, you would have to contact the appropriate office that oversees the land in question. Many here on TNEt will say if it's government land you have the right to detect it, end of story. That would be great if such simplistic reasoning were true, but it isn't true. I wish it were and I agree with many of their arguments for their position on the matter, but the truth is any of us can get into deep doodoo if we detect on lands that prohibit it. Such sites would include areas of historic significance, including many ghost towns and sites of former towns. When in doubt, check it out.
There is a law that says private property must be posted approximately every 1/4 mile if access is limited or totally denied. To access such lands is considered trespassing. Trespassing is never a good idea, and should never be condoned. However, if the land is unmarked and not fenced, it MIGHT be permissible to access it. Under such circumstances, I recommend being extremely respectful of the land and landowner and following the Code of Conduct for Metal Detectorists to the letter. Truth be told, I'd like to find the abandoned/vacant site of an old town myself, but most places like that here in CA are few and far between.