I need to block a city from accessing a site. Is this really possible? I have a client who insists they have seen it done, but I cannot find a way to find IP address ranges from just a certain city (I don't even think that exists?)
On the other hand, how does Google Analytics and other places know which cities visitors are coming from? So in that regard I guess maybe it is possible?
This is not possible. While you can use existing tools/scripts to try and get some decent results, there's no way to know by the visitor's IP if they are in a specific city or not, and unless the way TCP/IP works some day, or unless there's a real-time IP database that's very accurate for all of the IPs in existence that you can query, there will never be a workable method. Still, you can have some success to where it might be workable enough for the purpose.
Due to the way different ISPs handle their routing, Internet connections, and whois/reverse DNS entries, the closest you can guarantee would usually be the state the visitor is in. You may get better results with some of the largest ISPs (they are more likely to have proper reverse DNS entries set up), but some smaller providers might not provide any information other than where their headquarters is located. You may also wish to look into <A HREF="http://www.maxmind.com/app/ip-locate">GeoIP</A>, however it is not free.
I think this could be done by policy and policy enforcement through address verification. However, it would have almost as many holes as doing some GEO IP address thing.
-Mark Adams www.bitserve.com - Secure Michigan web hosting for your business.
Only host still offering a full money back uptime guarantee and prorated refunds.
Offering advanced server management and security incident response!
if he is planning to block 1000 Ip's its going to be tough if he plans to implement it after policy verification. And as far as i know the ipcountry stuff works good enough and its used to by programmers around the globe to implement their applications / websites. Ofcourse all these things has its own margin of errors
Sam Supportlobby.com - Expertise in Windows/Linux server support, IaaS and PaaS Management Spiralbean.com - Custom Software Development
Email: exec @ activelobby.net | Skype: unni_active