Geolocation by IP Address

Determining geographic locations based on Internet IP offers localization services and brings together user communities without the need for GPS receivers or complicated configuration switching.
Using DNS to Your Advantage

As previously mentioned, the NetGeo database slowly is becoming more inaccurate as IP address blocks change hands in company close-outs and absorptions. Several other tools are available for determining location, however. A description of the NetGeo infrastructure itself (see Resources) presents some of the methods it employed for mapping IP addresses and can be a source of guidance for future projects.

One of the most useful geolocation resources is DNS LOC information, but it is difficult to enforce across the Internet infrastructure. RFC 1876 is the standard that outlines "A Means for Expressing Location Information in the Domain Name System." Specifically, this is done by placing the location information of a server on the DNS registration page. Several popular servers have employed this standard but not enough to be directly useful as of yet.

To check the LOC DNS information of a server, you need to get the LOC type of the host:

$ host -t LOC LOC 37 23 30.900 N 121 59 19.000 W 7.00m 100m 100m 2m

This parses out to 37 degrees 23' 30.900'' North Latitude by 121 degrees 59' 19.000'' West Longitude at 7 meters in altitude, with an approximate size of 100 meters at 100 meters horizontal precision and 2 meters vertical precision. There are several benefits to servers that offer their geographic location in this way. First, if you are connecting from a server that shows its DNS LOC information, determining your geolocation is simple, and applications may use this information without further work, although some verification may be useful. Second, if you are connecting on your second or third bounce through a server that has DNS LOC information, it may be possible to make an estimate of your location based on traffic and ping times. However, it should be obvious that these estimates greatly degrade accuracy.

It also is possible to put the DNS LOC information for your Web site in its registration (see Resources). If more servers come to use LOC information, geolocation accuracy will be much easier to attain.

Sidebar: host

host is a DNS lookup utility that allows users to find out various pieces of information about a host. The simplest use is doing hostname to IP address lookups and the reverse. The reverse, dotted-decimal IPv4 notation, is used for this, and the actual server that hosts the canonical name is returned. The type flag, -t, can be used to obtain specific information from the host record from the name server.

Where There's a Name, There's a Way

Many users hopping onto the Internet probably aren't coming from a major server. In fact, most users don't have a static IP address. Dial-up, cable modems and cell phone connections are assigned a dynamic IP address that may change multiple times in one day or not at all for several weeks. Therefore, it becomes difficult to tie these dynamic addresses to a single location.

To our rescue, these service providers typically provide an internal naming scheme for assigning IP addresses and associating names with these addresses. Typically, the canonical name of an IP address contains the country-code top-level domain (ccTLDs) in a suffix. CN is China, FR is France, RO is Romania and so on. Furthermore, the name even may contain the city or region in which the IP address is located. Often, however, this information is shortened to some name that requires a heuristic to determine. For example, in your service or application, a user may appear to be coming from A whois at this address reveals it is a WideOpenWest account from Michigan. Using some logic, it is possible to deduce that this user is connecting through a server located in Troy, MI, hence the .try. in the canonical name.

Some projects have been started to decipher these addresses (see Resources), and you also can get all of the country codes and associated cities and regions of a country from the IANA Root-Zone Whois Information or the US Geospatial Intelligence Agency, which hosts the GEOnet Names Server (GNS). The GNS has freely available data files on almost all world countries, regions, states and cities, including their sizes, geographic locations and abbreviations, as well as other information.

Information such as that presented on the GNS also can be used to provide users with utilities and services specific to their geographical locations. For example, it is possible to determine a user's local currency, time zone and language. Time zone is especially useful for members of a community or chat group to determine when another friend may be available and on-line.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Is it possible?Suppose,How

save fuel's picture

Is it possible?Suppose,How can i know from where any E-mail has came?Is there any web-site to find out from where the mail has came?

Free Email Header Tracer at

kayla's picture

Try this, is a free service. :)
Just paste the email header and this site helps to check where is the email origin.

the best ip location

Anonymous's picture

my best ip checker proxy checker

San Francisco

Anonymous's picture

How could I tell when someone from San Francisco hits my site at:
Mister Archer: Undiscovered San Francisco Revealed?

Thank you!

need help with incorrect info on google

Anonymous's picture

nice Article and i got more info for this article and everybody visit my site and comments for my

when i first created the site i had no clue what was going on and tagged some SEO garbage in the discription as well as saved my site as with out the www. about a month ago i changed the discription in hopes that google would re-crawl and fix the information. i read i should submit a site map so i did but had to submit a new site with the WWW. in front. well google has re-crawled the site but nothing has changed when i perform the search for ross goodman photography. i am soo confused as to what to do about it, any help would be great thank you


Anonymous's picture

API für php in xml

Anonymous's picture

Good site

Anonymous's picture

I have to say... this is the first site that gives the right location of my IP address. All others are wrong (next big city around me).

IP Address Geolocation

Anonymous's picture

I found a new site to check out IP Address details through

check Ip of Gmx/ Scammer?

Anonymous's picture

I want to locate the adress of someone,maybe a scammer. IP is located in germany as the host is it possible to see in the mail,if it comes from germany or russia.
rom Tue Nov 10 15:44:35 2009
X-Apparently-To: via; Tue, 10 Nov 2009 09:47:37 -0800
X-YMailISG: x6XWZjcWLDtCbLMBoXtrt12aX1AVF89s.hd5pD0eA1ee9_3ovuor.vjAAwdYa1_OkSnCgdWhMUAZXCflX7R_RpTyUu3ZrX_hEQO7mHDdBOtgs5zw5FGO3ERcBBZxmeFwlZz_M4TZiM0RmXg2zGsL6BMTUZC7FjGSDfRlTAUmMt8PAp.aIAH3iNYIcd86JlBXvDT_C0ptYCV9_Rp.pksDt7Va738S_IqfD8WTPwPvOeAx8zQcbU5hofyAVF1U6pMT5NLTfJgGwfdh4jLcLbXT6T.CKUHxqGjjOcueBL2jMkG7O9c5qEieEiTIQPXLzF64LMMAEnSQh_NFm8i2hujUyzILkUeIGlfikFJIBNtNph_R77mLmKjbtdjIZc6aRobLJalZhVFp6U_r8Xe3MCaXbdlyOl7VEbztWNoIfsmcF98-
X-Originating-IP: []
Authentication-Results:; domainkeys=neutral (no sig);; dkim=neutral (no sig)
Received: from (HELO (
by with SMTP; Tue, 10 Nov 2009 09:47:37 -0800
Received: (qmail invoked by alias); 10 Nov 2009 17:47:28 -0000
Received: from (EHLO comp) []
by (mp013) with SMTP; 10 Nov 2009 18:47:28 +0100
X-Authenticated: #58738999
X-Provags-ID: V01U2FsdGVkX1++0sxFz5y+oquEYzLgvtyXQ32Bkx8AK8Qthdlybt
Date: Tue, 10 Nov 2009 18:44:35 +0300
X-Mailer: The Bat! (v3.99.3) Professional
X-Priority: 3 (Normal)
Message-ID: <>
To: =?iso-8859-1?Q?Sebastian_B=F6=DF?=
Subject: Guten Tag
In-Reply-To: <>
References: <> <> <> <> <> <> <> <> <>
MIME-Version: 1.0
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Y-GMX-Trusted: 0
X-FuHaFi: 0.71
Content-Length: 2814


Anonymous's picture

Look it's all a very good idea and all but i must be missing somthing.
What do i do when im sitting in england and my IP says that i am in austrailia! I need to change the setting becasue all UK websites that i want to access are not letting me. Please could someone help me, and just tell me simply how to change my location so i can visit uk sites again


I found a new site

Anonymous's picture

I found a new site to check out IP Address details through

hello I found a new site to

Anonymous's picture

I found a new site to check out IP Address details through

hai, You gave a benefits of

Anonymous's picture

You gave a benefits of geolocation using the ip address.It is nice.
But i collected the details of ip address and location from this ip-details.It also used to finding domain host,broadband speed,and latitude and longitude of the location.It is really helpful for me.


Misafir's picture

There are a so many services that has such function.

Is it possible?

sandeep's picture


My name is Sandeep.I am staying in Mumbai(India-Maharashtra).I want some help from you.

Is it possible?Suppose,How can i know from where any E-mail has came?Is there any web-site to find out from where the mail has came?


reply email tracing

Anonymous's picture

sandeep, all the tracing information for how the email was routed is in the emails meta data...all of it.
so even if the sender changes the name and service name manually or via can view and backtrack to the sender via the ip trail. Do a quick internet search for how to do this if you do not know how...a geoip type application/service can let you follow how the email got to you in reverse.
I recommend you do the lookups in reverse rather than just look at the last ip address as it may be a onion router relay or some such. If you hit an onion router or anonymizer well you will need to do some more deeper sleuthing.

Don't know why my previous

geoplugin's picture

Don't know why my previous post was deleted, but it's worth pointing out that this article is old and is no longer maintained.

For easy geolocation without any software requirements, geoPlugin offers a free webservice.

The geolocation examples page gives ideas on how to use the service, with detailed highlighted code.

IP Address Lookup

IP Address Lookup's picture

The best I know, is IP Address Lookup ! I am using it since I discovered it. It is very accurate.

needs more testing

prabu's picture

"Could not open postal code file"

Free country geolocation

Anonymous's picture

IP to city level geo info with Google map

Anonymous's picture provides very easy to use city level geolocation service. It also shows the location on the google map. You cal also create links of the type in any web page etc easy access to the service.

bloody annoying , language by geolocation's picture

I hate it. My browser can send my language preferences. And the websites ignore them simply because i am in some other country. I am an english speaker, and I want my web pages (yes you google and myspace) in ENGLISH!!!
If I wanted them in german, i'd set my system preferences or browser language preferences to german. Having regions in what is and should be an international internet is completely wrong.
And i would complain about the same thing if i was japanese traveling in England or America and getting english websites back. Or a spanish person traveling in norway. Hell, why the hell would I, as a spanish speaker, want to get my web pages viewed in Norwegian, just because I am traveling in that country.

IP Address Allocation Trend 2008

Jim KN's picture

I found the following report interesting about the trends of IP address allocation in 2007-2008. Some countries are growing at very fast rate.

ip location free service

Anonymous's picture

Good way to determine the ip location of a user with this ip-location free service.


There are a so many services

Alex T.'s picture

There are a so many services that has such function. But I created my own to get the easiest way to determine geo location.


Anonymous's picture

Your IP tool doesn't work. I'm nowhere NEAR where it says I am.

There are a so many services

Alex T.'s picture

There are a so many services that has such function. But I created my own to get the easiest way to determine geo location.

Could not open country code file

tonykbl's picture

When i go to view the example i get the following error 'Could not open country code file'

Free geolocation 'widget'

ned96's picture

Check out It runs on Amazon's ec2 infrastructure and you can use it as a javascript widget on your web page to track each and every customer who comes to your site. It gives latitude, longitude, city, state/province and country information.

Potentials of Geolocation Technique

portrait artist's picture

How effect is this technique? Isn’t it that one can manually change his or her IP? I’ve known that some webmasters especially the ones involved in marketing and advertising keep a record of free IPs in their file and manually changes their computer IP into another one. This new IP is registered as coming from someone located in Germany when actually the webmaster is from India. How can geolocation solve this?

RSS feeds?

gifts's picture

I'm seeing something, that I think, is pretty interesting with the idea of geolocations. Perhaps you can have some sort of “RSS feed

it's not always language

spenser's picture

For those jumping up and down about geolocation causing content to be delivered in other than their preferred language, yes, that is an improper use of the data since your browser sends an explicit preference. However, that aside, the data has uses. For example, some service providers try to point the user to the closest server in an attempt to provide faster service. That has nothing to do with privacy or language.

could not open postal code

Anonymous's picture

could not open postal code file

need help on IP

Anonymous's picture

what am i to do ?

someone is trying to find out my IP number. is this possible?
what can he do when he gets my Ip number?

yes it is possible.for

Anonymous's picture

yes it is possible.
for instance, if you are chatting with me then by running tracert command in command prompt in windows operating system, i could the list of ip address of the machine to which i'm connected now. then by simply closing all the other applications except the chatting application, i could find out your ip address

need help on IP

Anonymous's picture

what am i to do ?

someone is trying to find out my IP number. is this possible?
what can he do when he gets my Ip number?

free geolocation

Jack's picture

IPligence has a free geolocation database called IPligence community edition, it allows to find the ip location of ip addresses and its free to use for non commercial activities or develpment, it can be downloaded from this link:

correct link

Anonymous's picture

this one seems to work

I prefer the IP Locate

Paul.J's picture

I prefer the IP Locate service. Uses that ajax so its much smoothing. Happy new year all!

Find out your ip address and map it on google map

Puneet's picture

hi all,
use this link to find out your geographical location based on ip address

Another IP to location

Anonymous's picture

Another website that locates an ip address on a google map. It seems you can also enter a domain/website and find out where it is hosted .... interesting.


Zsuzsanna Vizi's picture

"Point your Web browser of choice here, and see how accurate or inaccurate the current results are."

The result is the following:
Could not open postal code file

I'm seeing article, that I

proxy site's picture

I'm seeing article, that I think, is charming interesting with the idea of geolocations. Perhaps you can have approximately sort of “RSS fuel up ..... it gets

Anonymous's picture ..... it gets the country right.... but every time i refresh i get a new city name

strange! i'd rather you got it wrong once rather than guessing it wrong constantly

Geolocation by IP address is

Anonymous's picture

Geolocation by IP address is a terrible practice. I, for example, am a US Citizen traveling in Japan. I do NOT speak or read Japanese. However, many web sites (google, skype, rhapsody, to name a few, as well as banner ads) redirect me to their Japanese web sites. Not only does this not do me any good at all, but I can't find my way back to an English written web site and when I do, it just redirects me back to the Japanese one as soon as I click a link! It's terribly frustrating, and in today's world of business, with global travelers and military deployed world-wide, the very idea of using one's IP address to determine language is laughable. Really, people, if you are going to link language to anything, you should be taking advantage of the protocol set forth specifically for doing so: the system user preference for language. I realize that while within one's own geographical confines, this IP binding practice may be beneficial, it is detrimental to the point of driving the end user insane outside of his or her native geographical region. Let's stop letting technology control us, and take back the reigns, because after all, technology is supposed to serve us, not the other way around.

It's a great Idea

Anonymous's picture

I travel a lot around Asia and nothing annoys me more than a foreigner who complains about things not being in English. If you don't intend to learn the language and culture then go home. As far as identifying IPs for specific countries, its a great idea, and if you want the world to change orbit for your arrogant ways well you won't find much sympathy on your travels so your post is pointless. A web page is going to guess what and how many langauges you can speak? How about you live up to being a global citizen and learn another language at least.

Read RFC 2616

Anonymous's picture

Before criticizing someone for asking that languages preferences, where possible, be respected, you need to read RFC 2616, the HTTP specification. It includes a request header named Accept-Language, which lists the languages a user can understand or is otherwise willing to accept, including ordering the languages by the user's preference.

It is not acceptable for sites such as Google or Yahoo (listed as well-known examples, not a criticism of what they actually do) to ignore the Accept-Language header and base the language used in a response on a guess of the user's geographic location. The reason it is not acceptable is that such behavior violates the protocol specification.

If you are an American in Japan and using Yahoo mail, you
would not want the buttons and other controls to be labeled
in Japanese if you did not know Japanese.

How about getting off your

Anonymous's picture

How about getting off your arrogant pedestal and admitting that maybe it's better that the technology serves the user rather than the other way around? Not everyone that's even a citizen or resident of a given country wants to see the majority language in that country just because their IP address happens to be identified as being in that region. (Think Spanish-speakers or Chinese-speakers in the US--it doesn't mean they don't speak the language, just that they prefer their own, for whatever personal or cultural reasons.) There is a specific setting in the browser that tells the server which language the user prefers. This has a very high probability of being correct. The IP address has a very high chance of being incorrect in this regard. Why should the server ignore the explicit directive from the user's own browser and decide that they should see what it thinks their IP address belongs to?

It really isn't a terrible

Anonymous's picture

It really isn't a terrible practice. If you truely are an international traveler you should get yourself a proxy and quit worrying about region specific websites. Don't blame the technology when you don't understand, or take the time to utilize effectively.