Geolocation by IP Address
The Internet has become a collection of resources meant to appeal to a large general audience. Although this multitude of information has been a great boon, it also has diluted the importance of geographically localized information. Offering the ability for Internet users to garner information based on geographic location can decrease search times and increase visibility of local establishments. Similarly, user communities and chat-rooms can be enhanced through knowing the locations (and therefore, local times, weather conditions and news events) of their members as they roam the globe. It is possible to provide user services in applications and Web sites without the need for users to carry GPS receivers or even to know where they themselves are.
Geolocation by IP address is the technique of determining a user's geographic latitude, longitude and, by inference, city, region and nation by comparing the user's public Internet IP address with known locations of other electronically neighboring servers and routers. This article presents some of the reasons for and benefits of using geolocation through IP address, as well as several techniques for applying this technology to an application, Web site or user community.
The benefits of geolocation may sound complex, but a simple example may help illustrate the possibilities. Consider a traveling businessman currently on the road to San Francisco. After checking into his hotel, he pulls out his laptop and hops onto the wireless Internet access point provided by the hotel. He opens his chat program as well as a Web browser. His friends and family see from his chat profile that he currently is near Golden Gate Park. Consequently, they can determine his local time. By pulling up a Web browser, furthermore, the businessman can do a localized search to find nearby restaurants and theaters.
Without having to know the address of the hotel he's staying in, the chat program and Web pages can determine his location based on the Internet address through which he is connecting. The following week, when he has returned to his home in Florida, he uses his laptop to log into a chat program, and his chat profile correctly places him in his home city. There is no need to change computer configurations, remember addresses or even be aware, as the user, that you are benefitting from geolocation services.
Possible applications for geolocation by IP address exist for Weblogs, chat programs, user communities, forums, distributed computing environments, security, urban mapping and network robustness. We encourage you to find out what applications and Web sites currently employ geolocation or could be enhanced by adding support.
Although several methods of geographically locating an individual currently exist, each system has cost and other detriments that make them technology prohibitive in computing environments. GPS is limited by line-of-sight to the constellation of satellites in Earth's orbit, which severely limits locating systems in cities, due to high buildings, and indoors, due to complete overhead blockage. Several projects have been started to install sensors or to use broadcast television signals (see Resources) to provide for urban and indoor geolocation. Unfortunately, these solutions require much money to cover installation of new infrastructure and devices, and these services are not supported widely yet.
By contrast, these environments already are witnessing a growing trend of installing wireless access points (AP). Airports, cafes, offices and city neighborhoods all have begun installing wireless APs to provide Internet access to wireless devices. Using this available and symbiotic infrastructure, geolocation by IP address can be implemented immediately.
As discussed below, several RFC proposals have been made by the Internet Engineering Task Force (IETF) that aim to provide geolocation resources and infrastructure. However, these standards have met with little support from users and administrators. To date, there has not been much interest in providing user location tracking and automatic localization services. Several companies now offer pay-per-use services for determining location by IP. These services can be expensive, however, and don't necessarily offer the kind of functionality a programmer may want when designing his or her Web site or application.
Several years ago, CAIDA, the Cooperative Association for Internet Data Analysis, began a geolocation by IP address effort called NetGeo. This system was a publicly accessible database of geographically located IP addresses. Through the use of many complex rules, the NetGeo database slowly filled and was corrected for the location of IP addresses. The project has been stopped, however, and the technology was licensed to new partners. However, the database still is available, although several years old, and provides a good resource for determining rough locations.
To query the NetGeo database, an HTTP request is made with the query IP address, like this:
-- $ http://netgeo.caida.org/perl/netgeo.cgi?target=192.168.0.1 VERSION=1.0 TARGET: 192.168.0.1 NAME: IANA-CBLK1 NUMBER: 192.168.0.0 - 192.168.255.255 CITY: MARINA DEL REY STATE: CALIFORNIA COUNTRY: US LAT: 33.98 LONG: -118.45 LAT_LONG_GRAN: City LAST_UPDATED: 16-May-2001 NIC: ARIN LOOKUP_TYPE: Block Allocation RATING: DOMAIN_GUESS: iana.org STATUS: OK --
As you can see, the NetGeo response includes the city, state, country, latitude and longitude of the IP address in question. Furthermore, the granularity (LAT_LONG_GRAN) also is estimated to give some idea about the accuracy of the location. This accuracy also can be deduced from the LAST_UPDATED field. Obviously, the older the update, the more likely it is that the location has changed. This is true especially for IP addresses assigned to residential customers, as companies holding these addresses are in constant flux.
In order to make this database useful to an application or Web site, we need to be able to make the request through some programming interface. Several existing packages assist in retrieving information from the NetGeo database. The PEAR system has a PHP package (see Resources), and a PERL module, CAIDA::NetGeo::Client, is available. However, it is a relatively straightforward task to make a request in whatever language you are using for your application or service. For example, a function in PHP for getting and parsing the NetGeo response looks like this:
--
1: function getLocationCaidaNetGeo($ip)
2: {
3: $NetGeoURL = "http://netgeo.caida.org/perl/netgeo.cgi?target=".$ip;
4:
5: if($NetGeoFP = fopen($NetGeoURL,r))
6: {
7: ob_start();
8:
9: fpassthru($NetGeoFP);
10: $NetGeoHTML = ob_get_contents();
11: ob_end_clean();
12:
13: fclose($NetGeoFP);
14: }
15: preg_match ("/LAT:(.*)/i", $NetGeoHTML, $temp) or die("Could not find element LAT");
16: $location[0] = $temp[1];
17: preg_match ("/LONG:(.*)/i", $NetGeoHTML, $temp) or die("Could not find element LONG");
18: $location[1] = $temp[1];
19:
20: return $location;
21: }
--
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
- RSS Feeds
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
- Dynamic DNS—an Object Lesson in Problem Solving
- New Products
- Validate an E-Mail Address with PHP, the Right Way
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Download the Free Red Hat White Paper "Using an Open Source Framework to Catch the Bad Guy"
- Tech Tip: Really Simple HTTP Server with Python
- Roll your own dynamic dns
2 hours 30 min ago - Please correct the URL for Salt Stack's web site
5 hours 41 min ago - Android is Linux -- why no better inter-operation
7 hours 56 min ago - Connecting Android device to desktop Linux via USB
8 hours 25 min ago - Find new cell phone and tablet pc
9 hours 23 min ago - Epistle
10 hours 52 min ago - Automatically updating Guest Additions
12 hours 52 sec ago - I like your topic on android
12 hours 47 min ago - This is the easiest tutorial
19 hours 23 min ago - Ahh, the Koolaid.
1 day 1 hour ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?



Comments
Is it possible?Suppose,How
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 ip2location.com
Try this, is a free service. :)
Just paste the email header and this site helps to check where is the email origin.
http://www.ip2location.com/emailtracer.aspx
the best ip location
my best ip checker proxy checker
San Francisco
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
Hi,
nice Article and i got more info for this article and everybody visit my site and comments for my Article.www.adnpost.com
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 rossgoodmanphotography.com 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
usercenter
http://www.mshd.net/usercenter/
API für php in xml
Schau mal hier
http://s.site90.com/ip.php
für das API
Erklärung: http://s.site90.com/homepage-xml.php
XML-Datei: http://s.site90.com/hp/xml.php?type=ip&ip=95.33.207.124
:) lg martin
Good site
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
I found a new site to check out IP Address details through
www.ipaddressgeolocation.com
check Ip of Gmx/ Scammer?
Hi,
I want to locate the adress of someone,maybe a scammer. IP is located in germany as the host is gmx.de.Is it possible to see in the mail,if it comes from germany or russia.
rom anfisa.s@gmx.de Tue Nov 10 15:44:35 2009
X-Apparently-To: pinasystems24@yahoo.de via 87.248.110.125; Tue, 10 Nov 2009 09:47:37 -0800
Return-Path:
X-YMailISG: x6XWZjcWLDtCbLMBoXtrt12aX1AVF89s.hd5pD0eA1ee9_3ovuor.vjAAwdYa1_OkSnCgdWhMUAZXCflX7R_RpTyUu3ZrX_hEQO7mHDdBOtgs5zw5FGO3ERcBBZxmeFwlZz_M4TZiM0RmXg2zGsL6BMTUZC7FjGSDfRlTAUmMt8PAp.aIAH3iNYIcd86JlBXvDT_C0ptYCV9_Rp.pksDt7Va738S_IqfD8WTPwPvOeAx8zQcbU5hofyAVF1U6pMT5NLTfJgGwfdh4jLcLbXT6T.CKUHxqGjjOcueBL2jMkG7O9c5qEieEiTIQPXLzF64LMMAEnSQh_NFm8i2hujUyzILkUeIGlfikFJIBNtNph_R77mLmKjbtdjIZc6aRobLJalZhVFp6U_r8Xe3MCaXbdlyOl7VEbztWNoIfsmcF98-
X-Originating-IP: [213.165.64.20]
Authentication-Results: mta132.mail.sp2.yahoo.com from=gmx.de; domainkeys=neutral (no sig); from=gmx.de; dkim=neutral (no sig)
Received: from 127.0.0.1 (HELO mail.gmx.net) (213.165.64.20)
by mta132.mail.sp2.yahoo.com with SMTP; Tue, 10 Nov 2009 09:47:37 -0800
Received: (qmail invoked by alias); 10 Nov 2009 17:47:28 -0000
Received: from HSI-KBW-095-208-174-017.hsi5.kabel-badenwuerttemberg.de (EHLO comp) [95.208.174.17]
by mail.gmx.net (mp013) with SMTP; 10 Nov 2009 18:47:28 +0100
X-Authenticated: #58738999
X-Provags-ID: V01U2FsdGVkX1++0sxFz5y+oquEYzLgvtyXQ32Bkx8AK8Qthdlybt
V0TAN5UzWhz5Wo
Date: Tue, 10 Nov 2009 18:44:35 +0300
From: anfisa.s@gmx.de
X-Mailer: The Bat! (v3.99.3) Professional
X-Priority: 3 (Normal)
Message-ID: <661978319.20091110184435@gmx.de>
To: =?iso-8859-1?Q?Sebastian_B=F6=DF?=
Subject: Guten Tag
In-Reply-To: <860504.55087.qm@web28310.mail.ukl.yahoo.com>
References: <446603.25418.qm@web28305.mail.ukl.yahoo.com> <1403195454.20091105184430@gmx.de> <274517.18777.qm@web28303.mail.ukl.yahoo.com> <92284562.20091106172448@gmx.de> <858029.45638.qm@web28306.mail.ukl.yahoo.com> <1853119150.20091107184127@gmx.de> <629756.68244.qm@web28316.mail.ukl.yahoo.com> <18010060205.20091109172601@gmx.de> <860504.55087.qm@web28310.mail.ukl.yahoo.com>
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
HELP!
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
Cheers
I found a new site
I found a new site to check out IP Address details through
http://www.ipaddressgeolocation.com
hello I found a new site to
hello
I found a new site to check out IP Address details through www.IpAddressGeolocation.com
hai, You gave a benefits of
hai,
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.
services
There are a so many services that has such function.
Is it possible?
Sir/Madam,
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?
Thanks!
Sandy.
reply email tracing
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 bot...you 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
Don't know why my previous post was deleted, but it's worth pointing out that this article is old and netgeo.caida.org 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
The best I know, is IP Address Lookup ! I am using it since I discovered it. It is very accurate.
needs more testing
"Could not open postal code file"
Free country geolocation
Free country geolocation service
IP to city level geo info with Google map
IpGeoInfo.com 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 http://ipgeoinfo.com/?ip=YOUR_IP in any web page etc easy access to the service.
bloody annoying , language by geolocation
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
I found the following report interesting about the trends of IP address allocation in 2007-2008. Some countries are growing at very fast rate.
http://www.ip2location.com/ip2location-internet-ip-address-2008-report.aspx
ip location free service
Good way to determine the ip location of a user with this ip-location free service.
D.A.
There are a so many services
There are a so many services that has such function. But I created my own to get the easiest way to determine geo location.
Beta?
Alex,
Your IP tool doesn't work. I'm nowhere NEAR where it says I am.
There are a so many services
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
When i go to view the example i get the following error 'Could not open country code file'
Free geolocation 'widget'
Check out http://freeipservices.com. 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
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?
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
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
could not open postal code file
need help on IP
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
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
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
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:
http://www.ipligence.com/en/products/community.php
correct link
this one seems to work http://www.ipligence.com/community
I prefer the IP Locate
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
hi all,
use this link to find out your geographical location based on ip address
www.geo-location.com/cgi-bin/index.cgi
Another IP to location
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.
www.geo-ip.info
geolocation
"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
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
Hostip.info ..... it gets
Hostip.info ..... 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
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
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
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
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
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.