Do you know of any service which given an ip address it returns a location/country? I found a few lists we can add to our database but do I need to update them often? Is there any rule (like telephone numbers) to know the country of origin?
Sorry, I know this might sound a stupid question but for what we're doing it can't fail.
EDIT: I forgot to mention this has to be accessible programmatically (PHP)
Thanks :) Diogo
The IP address routes Internet traffic to your computer. To clarify, it does not reveal your location. If someone was able to get your IP address they could learn a bit about your Internet service, such as which provider you use to connect to the Internet, but they really can't locate you, your home, or your office.
You may also use 3rd party websites such as Geobytes or Dnsstuff to lookup the IP address. The whois lookup will reveal name of the ISP who owns that IP address, and the country where it is originated from. If you're lucky, you might also find the city of orgin.
Check this out: http://www.farhad.ca/2011/06/15/rbl-based-ip-to-location/
Assume IP address of question is 10.11.12.13, then here is a sample:
<?php
$ip_address = gethostbyname('13.12.11.10.rbloc.dayanadns.com');
list($d1,$d2,$d3,$d4) = explode('.',$ip_address);
$country_code = chr($d3).chr($d4);
print "Result address: ".$ip_address."\n";
print "Country code: ".$country_code."\n";
?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With