Is there a way to block visitors from a city, specifically Rockville, Maryland without affecting entire Maryland and USA? I mean only IP addresses coming from Rockville only. I know it can't be blocked 100% but at least i need to block them.
MaxMind has IP databases that can give you the country and city of origin for a given IP. They have free (geolite city) and paid (geoip city) versions, the latter is more accurate of course. I use their free country database so I don't know whether the city version also provide the state. If not you should search that DB for all places in Maryland.
Google: maxmind geolite country or Google: maxmind geolite city The first results should get you there and then you have several options for downloading the database, either in CSV format to store in e.g. a MySql database or in a binary format for which an API is provided.