Where is this IP address, IPv4 and IPv6
Archive - Originally posted on "The Horse's Mouth" - 2009-01-04 09:40:01 - Graham EllisDo you want to know where in the world an IP address comes from? I often do and I've used a number of tools - but they tend to draw me fancy maps and lead me away from my page. So this morning I put together a cheap and cheerful "which country is this IP from?" script, using Maxmind Open Source Technology which just produces a little popup. Oh - and if you cut and paste an IP address with leading and / or trailing spaces into it, it actually works too.


There's a permanent link to this utility on our front page which I invite you to bookmark and use. And you may wonder what the "distance" indicator is that sometimes comes up on your results. It's a very rough guess at the distance (in miles) that the IP address given is from our training centre, because I would love you to be remember our training courses ... we'll teach you how to write little toys like this one on our PHP techniques workshop, for example.
And for the more technical ...
IPv6 cases considered:
Full IP6 e.g. 65e1:763d:6652:1342:0725:4c65:1424
Shortened IP6 e.g. ::1a72:189 and 1234::17a3:712
IP4 mapped current e.g. ::ffff:64ed:54
IP4 mapped obsolete e.g. ::8c4b:430a
Teredo Tunneling: e.g. 2001:0::154a:19:a4
ORCHID: e.g. 2001:0013:64ec::879a:0:15
Documentation e.g. 2001:0db8:1342:0725::1a:74a0
Multicast e.g. ff75:7762::
Local, Managed e.g. fc05:8854:87::65
Local, Random e.g. fd76:638d:c737:83ab:552c:6509:65ab:817
Site-local (deprecated) e.g. fed5:7764:9a77::
Link-local e.g. feab:17:18:e745::65a
Unconfigured i.e. ::0
Loopback i.e. ::1
IPv4 cases considered:
Full IP4 address e.g. 83.170.95.163
Automatic private addresses e.g. 169.254.67.128
Local class A addresses e.g. 10.1.0.16
Local class B addresses e.g. 172.18.0.7
Local class C addresses e.g. 192.168.0.1
The local class C network we use e.g. 192.168.200.215
Loopback e.g. 127.0.0.1
Class D (multicast) e.g. 224.0.0.4
Class E (experimental) e.g. 246.86.55.164
And (though it's a bit of an aside), here's the Javascript and form that I've used on this page for the popup:
<script type="text/javascript">
function popUp(myURL) {
day = new Date(); id = day.getTime();
window.open('', id, 'height=308,width=250,scrollbars=1,
toolbar=0,location=0,statusbar=0,resizable=0,menubar=0');
myURL.target=id; return true; } </script>
<form method=GET action="/resources/iptool.html"
onSubmit="popUp(this)"> Ask about ip: <input name=ip
size=31 value="83.170.95.163"><input type=submit value=go!>
</form>