Why do you need geolocation?
There are a several ways to find geolocation of a user: HTML5 API, Cell There are also several ways to find geolocation of a user: HTML5 API, Cell Signal and IP Address to name a few. Pairing of IP address to a geographical location is the method we used to provide geolocation data. There are times when you need to identify where your web visitors are coming from. You might have an ecommerce website, and would like to know where your potential customers are, pre-populate country code on forms, display different language and reduce credit card fraud based on geographic location. Or, you might want to fight against illegal spammers and hackers, and would like to locate source of a problem.
Although it would be nice to be able to find precise location of a visitor, it is almost impossible to find exact location of a host given its IP address. However, there are tools available to help identify approximate location of the host. ARIN Whois database provides a mechanism for finding contact and registration information for IP resources registered with ARIN.
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. You may also use products developed by 3rd-party companies like Ip2location and MaxMind. Our sister website, findmyip.org also provides a geographic information of your IP address.
You may also use reverse DNS to find out the hostname of the IP address, which might give you some clues. Many ISPs, Corporations and Academic institutions use location as a qualified hostname, although this is not always true. A couple of things to note here: (1) Reverse DNS translation does not always work. It depends on the correct configuration of the ISP's DNS server. (2) The US domain names such as .com, .net and .org does not always imply that the host is located in the United States.
You may use 'traceroute' command to find clues to the location of the IP address. The names of the routers through which packets flow from your host to the destination host might hint at the geographical path of the final location.