Correcting your DB

General Discussion about IP Address Lookup caveats, technology, ideas, etc.

Moderator: Moderators

Correcting your DB

Postby Tom on Mon May 29, 2006 9:44 am


First off, I REALLY love your project's idea.
So much that I took the time to register to post to these forums :)

So. Here's my deal. I need to get detailed visitor info for a client's site of just my area. I don't really care much beyond a 50mile radius.

Are IP addresses that detailed? Does anyone know?
I assume they are as Google is telling me several small towns on their Analytics.. (I guess provided by Urchin)

And MaxMind is off telling me I'm from a town about 20-25min away.

(...yes, I've done my homework about this stuff, but still have questions)

So, I check out your site and it can't find my IP. Not even Philadelphia, PA which is the closest major city to me. Everyone gets that, but hostip didn't. It guessed way wrong and appeared to be randomized ... but is this a ploy on the front page to get people to enter their locations because one would think you guys are "way off" - "let me fix that for you" type thing?

I can't see how you would miss the major metro area. BUT in case you did, here's my idea/suggestion/solution.

Go to and grab their free GeoLiteCity database and use it to cross reference yours, or double check some things.

Their lite version isn't as accurate as their website (I assume pay version) but their pay version isn't as accurate Google Analytics.

So my next idea was to build my own database for my own area.
Since my client has a survey on their page, I added IP logging to it. So now I have my sql database recording not only the IP, but the entered town, zip, and heck even addresses and personal interests.

Those are not of my conern, merely the zip/town and ip. The problem is of course it's up to human entry much like hostip. So people could be entering in false information. I'm assuming they won't as it's a local thing and prizes are actually offered (people could win a big screen tv at one point, and yes it was for real, I was there when they tried to e-mail the poor lady about 50 times and never got ahold of her) So people do take it seriously and I can trust it - plus I could cross reference the results and eventually find out if someone is lying anyway - unless more people lie than tell the truth.

So that all said - how detailed do you think the IP addresses get? Can I tell within a 5mile radius? For each small town?

Any other way of telling? Looking up ARIN only gives the metro area. So I know where to stop with the IP ranges I guess before hitting another state or major city ... but still that's like 50-100miles.. I need more accurate.

Can I scan the network I'm on for my ISP and find other connected IP's ?
Then assume that all of those are on my ISP for my town? (leaves other isps out but...)


PS - why do I need the detailed data? Simply because they have advertisers and would like to be able to tell them that X amount of people from this town clicked on your ad. Rather than X amount of people from Philly - which does them no good - they are local businesses outside the major metro area.
Posts: 1
Joined: Mon May 29, 2006 9:33 am

Postby robocoder on Tue May 30, 2006 9:07 am

Yes, the home page encourages visitors to submit corrections when the IP (in its corresponding /24 range) has no assigned city in the database.

The IP-to-city lookup corresponds to this API:

If you want a better guess, try:

The city-level is the highest level of granularity that can be expected. For non-ISP organizations (which have fixed/static IPs), you could conceivably pull the address from the whois record.

The city level isn't that bad. A 13 mile radius covers 530 sq. mi. in area. New York City -- while not a circle -- is only about 470 sq. mi. in area.
User avatar
Posts: 105
Joined: Sat Mar 25, 2006 8:10 pm
Location: Ontario, Canada

Return to IP Address Lookup

Who is online

Users browsing this forum: No registered users and 2 guests