Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been enjoying the benefits of Geo IP lookup from database for some time. It's great.

People are increasingly trying to access my site from a mobile phones or 3G modems, and their physical location seems to have little relation to whereabouts my IP lookup tells me they are. A user who is on the east coast of my country, may be looked up as being in the far inland, or up north. And one user may be reported as being in one location in one moment, and seconds later, be 100s of kilometers away.

This is becoming a problem, and I need to find a solution. I am already updating my database monthly, but it has little effect.

What can be done?

share|improve this question
I'll sound unhelpful here (hence this being a comment, rather than an answer): It would sound like the solution, to me, would be a protocol to allow the user to opt-in to revealing their geographical information (as pulled from their GPS, etc) rather than attempting to unreliably infer it from IP address. I rather like the idea of my IP address not having any geographical connotations. >smile< – Evan Anderson Mar 24 '10 at 19:26
1 – Mark Henderson Mar 24 '10 at 21:06

One option is to use geolocation in the browser. Not many devices support it however. Ultimately, GeoIP is an unreliable hack.

share|improve this answer

Have you considered just asking users to enter their zip code?

share|improve this answer
Just as long as this is done properly. Every time I go to the website for my favourite hardware store on my mobile (yes, - I'm talking to you) they FORCE me to enter my post code and won't let me continue without it. The fact of the matter is a lot of the time I don't KNOW what my current postcode is, and the information I'm after has absolutally no bearing on my current location. So this sort of approach needs to be thought out carefully. – Mark Henderson Mar 24 '10 at 21:05
You've hit upon a problem with your answer in the very answer itself: The world is a very large place and some parts of it aren't where you are from: Not all of us have a "zip code". Parsing all the possible alternatives to a Zip Code is far from a trivial task. – RobM Nov 15 '10 at 17:00

How about linking up with an external GeoIP database, rather than maintaining your own?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.