Questions tagged [geoip]

GeoIP is the process of analyzing an IP address and determining the geographical location of that end point.

GeoIP assigns a location to an IP address, generally by doing a lookup in a specifically created database. Popular providers are MaxMind, Google, InfoSniper, and IP2Location. These, in turn, are based on Regional Internet Registries (RIR).

Common uses for this location information include:

  • Selecting the closest mirror for a download
  • Providing region specific billing information (currency, shipping cost)
  • Regionalizing the content of a page (local deals or specials)
694 questions
5
votes
2 answers

GeoIP and IP to Country in PHP

Possible Duplicate: How to get the page visitors Country with PHP? I've been searching everywhere, and I can't seem to find anything. I need a free PHP GeoIP/Ip to country. All I can find is that it gives me the country and small form of the…
David Tkachuk
  • 116
  • 1
  • 2
  • 7
5
votes
2 answers

How to make geoip_country_name_by_name() work?

I want to collect country name of an user who logined to my site. So i used geoip_country_name_by_name() php function for this purpose. But i got a fatal error as : Fatal error: Call to undefined function geoip_country_name_by_name() How can i…
Micku
  • 550
  • 4
  • 9
  • 23
4
votes
1 answer

geopip record is always null?

I have access to the GeoIP.dat file through my current host but every IP I enter is empty. Any idea what might be wrong or a way to troubleshoot it? I have php errors on but I don't see anything wrong. Here is my current…
Paul
  • 11,671
  • 32
  • 91
  • 143
4
votes
3 answers

How does one detect Middle East visitors via PHP?

I'm looking for a clear cut way to detect if a visitor is from the Middle East. If they are, I need to display a different header image (the current one has a hog in it, so it is frowned upon). I can code the if then else for that, but I'm just…
hatfieldajoshua
  • 307
  • 1
  • 4
  • 15
4
votes
2 answers

MaxMind pulling Geolite2 gets 401 Unauthorized

Geolite2 access changed on 12/30. Today I registered for a Maxmind account, registered a license key (both one that "Will this key be used for GeoIP Update?" and one that will not) .. and now each time I enter I get a 401: smachine:~# wget…
jg3
  • 503
  • 5
  • 12
4
votes
2 answers

NginX GeoIP Module Config - load_module not allowed on First Line of Conf

My nginx conf looks like this: include /usr/share/nginx/modules/mod-http-geoip.conf; server { } server { } I had installed mod-http-geoip via sudo yum install nginx-mod-http-geoip and i have…
user1955934
  • 3,185
  • 5
  • 42
  • 68
4
votes
2 answers

MaxMind Writer to create custom database to use with geoip in ELK Stack

I'm trying to create a custom database for an internal network using the perl Writer from MaxMind, which is working good so far. I then try to geolocate these IP ranges with the geoip filter plugin in logstash. I can verify that that the created…
emcewees
  • 71
  • 1
  • 7
4
votes
2 answers

Best way to get user nearest city? Python/Django

I have a website with a limited number of cities in the database, and need to show the user the nearest city to his current location. I can get the location by MaxMind API, but I want to get the nearest city in my database to user city. For example,…
Leandro Ardissone
  • 3,009
  • 6
  • 32
  • 31
4
votes
1 answer

MaxMind's GeoIP database

I found that the MaxMind's GeoIP database's accuracy is 99.5% (free) or 99.8% (commercial), as published in their website. Does anybody know what would be the 0.5% and the 0.2% ? Are they newly assigned IP addresses, or actual addresses that change…
medk
  • 9,233
  • 18
  • 57
  • 79
4
votes
1 answer

Python GeoIP2 AddressNotFoundError

Im trying to use Python GeoIP to convert IP address to Geo details using Maxmind Database. import urllib2 import csv import geoip2.database db = geoip2.database.Reader("GeoLite2-City.mmdb") target_url="http://myip/all.txt" data =…
Karthik
  • 363
  • 2
  • 7
  • 20
4
votes
0 answers

how to use maxmind geoip2 in Spark Streaming?

I want to use maxmind geoip2 to process IP info with Spark Streaming, but I could not find any example? For spark, I can use sc.addFile(gepip.mmdb) and mapPartitions with https://github.com/Sanoma-CDA/maxmind-geoip2-scala or …
Allen Shen
  • 148
  • 1
  • 10
4
votes
1 answer

Intermittent ImportError with Django package

I have the following import line in a Django 1.4 project running in Python 2.7.6: from django.contrib.gis.utils import GeoIP This line works just fine 100% of the time in production and in development, but this line fails with an ImportError in…
ryanmrubin
  • 728
  • 4
  • 11
4
votes
4 answers

getCity/state from IP address using PHP

I am working on a client project, where he needs the city/state of the user by taking his ip address. 1) he has purchased maxmind GeoIP2 Precision, but no idea how to implement the code in php. documentation says some instruction to download…
Aman
  • 137
  • 1
  • 2
  • 9
4
votes
4 answers

python sys.stdin.read() from tail -f

How come sys.stdin.read() doesn't read the piped input from tail -f? #!/usr/bin/env python import sys from geoip import geolite2 def iplookup(srcip): for ip in srcip.split("\n"): try: …
dobbs
  • 1,089
  • 6
  • 22
  • 45
4
votes
2 answers

MaxMind GeoLite mysql vs binary dat performance

I am wondering if there is any huge performance difference choosing binary dat and using MaxMind php api vs importing GeoLite csv into mysql database and using database. dat format is 20 MB and it needs reading it from disk every time. It will be…
JohnyFree
  • 1,319
  • 3
  • 22
  • 35