How accurate is GeoIP and $_SERVER['REMOTE_ADDR']?

时光毁灭记忆、已成空白 提交于 2019-12-10 14:57:21

问题


I make a website for my girlfriend and she recently wants to know who is accessing her site. So I use the database of MindMax and I got the list and count of access by country.

However, after monitoring it for a few days, it is comes to our surprise that there are accesses from some countries which the website is not target to. Of course, it does not means that I think it is impossible for people from those countries will be interested but it just rises a question of accuracy. So How accurate is GeoIP and $_SERVER['REMOTE_ADDR'] (which is used to look up)?

I don't care much about those who intentionally hide or fake their IP. I just more interested to know if there is thing out there that may unintentionally make this inaccurate (e.g., routing).


回答1:


Well based on their web page their DB is "99.8% accurate on a country level" ...




回答2:


There was quite a while (months) after I got Wimax service at home when GeoIP didn't have a clue where I was. I presume this is because the IP block that my ISP uses is "new" and hadn't been mapped to anything yet.

I noticed this because a website (that was trying to be "cute" by telling me where I was) said something like "Hello visitor from ... actually, we don't have a clue where you're from." (I imagine that there was a comment about that print statement that said something like /* This should never happen */. )




回答3:


Always keep your binary database updated as it is updated on the first Tuesday of every month.

GeoLite Country and GeoLite City are free IP geolocation databases, updated on the first Tuesday of each month. GeoLite and GeoIP databases share the same format and APIs.

http://www.maxmind.com/app/geolite



来源:https://stackoverflow.com/questions/1877110/how-accurate-is-geoip-and-serverremote-addr

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!