0

Is there an easy way to detect user region using IP address? I'd assume that each region will have a specific IPv4 range assigned.

  • I don't want to rely on any 3rd party service (except initial data import)
  • Precision does not need to be 100%, but should be reasonably high (at least ~80%)
  • I only want to guess users region (Europe, Asia, Africa, ...). No need for city/country.
Petr Peller
  • 8,581
  • 10
  • 49
  • 66
  • Possible duplicate of [Get user location by IP address](http://stackoverflow.com/questions/4327629/get-user-location-by-ip-address) – Idos Feb 28 '16 at 15:27

1 Answers1

0

Not sure what language you're using. But you can do it with GeoIP or similar modules. If you dont want any 3rd party libraries at all you can make a function based on IANA numbers https://www.iana.org/number. Especially look under "IPv4 Address Space".

Mr. H
  • 55
  • 9