Home > Programming, Servers & Scripts >

Find IP ranges for City? (7)


06-23-2016 11:08 PM #1 urbanleaf (Member)
Find IP ranges for City?

I may be looking for the impossible here, but does anyone know of a way that i can pull all IP addresses for a given city?

Thanks in advance!


06-24-2016 02:42 AM #2 mobile_ad_monitor (Member)

GeoIP MaxMind can identify ip address in a city. Pulling all of the ip addresses in a city would require knowing the patterns. You'd need to develop a database and reverse engineer what MaxMind has.


06-24-2016 03:07 AM #3 albinoazul91 (Member)

you dont need that actually, bc there are several API paid services that depending on ip you send them they return city, country, AS, ISP, zip, etc. Im actually using http://ip-api.com/ that works very well and is not expensive, pretty recommendable, so you will only need a list of cities and in your code write kinda if IP is from X city THEN do this.


06-24-2016 09:37 AM #4 urbanleaf (Member)

Thanks mobile_ad_monitor, had a feeling I may need to create something...any idea what I should be paying to have something like that developed?


06-24-2016 10:47 AM #5 caurmen (Administrator)

@urbanleaf - It's a pretty trivial job, in actual fact. Maxmind's database is available in .CSV format, which you can just pull into any database of your choice.

Then you can get all the IP addresses for any city with a single SELECT statement on the database.


06-24-2016 12:47 PM #6 urbanleaf (Member)

Nice one, thanks Caurmen, makes a lot more sense.

I have got the geolitecity-blocks.csv and the location.csv which seem to pair up via the location IDs and the decimal IPs given seem accurate so should be sorted!


05-10-2017 03:53 PM #7 poker007 (Member)

Hey caurmen, I'm still new and don't have a lot of data so I'm using excel spreadsheets. But thinking long-term and to avoid growing pains, I'd like to incorporate a database to query, could you please advise on a good database setup?

Thanks


Home > Programming, Servers & Scripts >