Connecting Tech Pros Worldwide Forums | Help | Site Map

How to determine the Country and Organization from IP

Amardeep Verma
Guest
 
Posts: n/a
#1: Jul 17 '05
Hi,
I would like to determine the Country and Organization from a given
IP. I have to write a JSP, which when given the IP address gives the
country and the organization to which the IP belongs. The organization
may be the ISP, or a MNC or any other corporate/government body, or it
may be of an individual. I have to do it progamitically from inside a
JSP?
Any suggestions anybody

Thanks in Advance for your reply

Grant Wagner
Guest
 
Posts: n/a
#2: Jul 17 '05

re: How to determine the Country and Organization from IP


Amardeep Verma wrote:
[color=blue]
> Hi,
> I would like to determine the Country and Organization from a given
> IP. I have to write a JSP, which when given the IP address gives the
> country and the organization to which the IP belongs. The organization
> may be the ISP, or a MNC or any other corporate/government body, or it
> may be of an individual. I have to do it progamitically from inside a
> JSP?
> Any suggestions anybody
>
> Thanks in Advance for your reply[/color]

Do a whois lookup, then parse the results that are returned. You could do
something as simple as:

<url: http://ws.arin.net/cgi-bin/whois.pl?...nput=127.0.0.1 />

then parse the HTML returned.

Or find some service that allows SOAP calls, or a service that returns the
data in an easier to parse format, such as XML or comma-delimited.

--
| Grant Wagner <gwagner@agricoreunited.com>

Ivan Pechorin
Guest
 
Posts: n/a
#3: Jul 17 '05

re: How to determine the Country and Organization from IP


Amardeep Verma wrote:
[color=blue]
> I would like to determine the Country and Organization from a given
> IP.[/color]

MaxMind provides free databases, derived from APNIC, ARIN, LACNIC, and
RIPE WHOIS databases, and APIs for a number of languages, including Java.

http://www.maxmind.com/
http://www.maxmind.com/app/java

--
Ivan Pechorin

Michael Winter
Guest
 
Posts: n/a
#4: Jul 17 '05

re: How to determine the Country and Organization from IP


One problem with this (as I have found recently) is that there are four
***independent*** regional Internet registries. However, the American
(North) and sub-equatorial African registry (ARIN - www.arin.net) does seem
to point you to which registry does contain the information, if they don't,
on a regular basis. This will require more parsing on your behalf.

The four registries are:

APNIC (http://www.apnic.net/) - Asia (Pacific).
ARIN (http://www.arin.net/) - North America, (part of) the Caribbean, and
sub-equatorial Africa.
LACNIC (http://lacnit.net/) - Latin America and the Caribbean.
RIPE (http://www.ripe.net/) - Europe, the Middle East, Central Asia, and
Africa.

I don't know if there is a central database (there probably isn't), but some
web-sites do query all of the registries. I knew one that would allow HTTP
GET requests, but it's disappeared from my browser history (?!?!).

Michael

--
M.Winter@(I_hate_spam)blueyonder.co.uk
Remove "(I_hate_spam)" to reply.

"Grant Wagner" <gwagner@agricoreunited.com> wrote in message
news:3F328FC6.B45861C9@agricoreunited.com...[color=blue]
> Amardeep Verma wrote:
>[color=green]
> > Hi,
> > I would like to determine the Country and Organization from a given
> > IP. I have to write a JSP, which when given the IP address gives the
> > country and the organization to which the IP belongs. The organization
> > may be the ISP, or a MNC or any other corporate/government body, or it
> > may be of an individual. I have to do it progamitically from inside a
> > JSP?
> > Any suggestions anybody
> >
> > Thanks in Advance for your reply[/color]
>
> Do a whois lookup, then parse the results that are returned. You could do
> something as simple as:
>
> <url: http://ws.arin.net/cgi-bin/whois.pl?...nput=127.0.0.1 />
>
> then parse the HTML returned.
>
> Or find some service that allows SOAP calls, or a service that returns the
> data in an easier to parse format, such as XML or comma-delimited.
>
> --
> | Grant Wagner <gwagner@agricoreunited.com>
>[/color]


Amardeep Verma
Guest
 
Posts: n/a
#5: Jul 17 '05

re: How to determine the Country and Organization from IP


Thanks ivan, your suggestion is very close to what i required. If you
know of any other organization or service offering the same service,
please do let me know.

Thanks
Amardeep Verma

Ivan Pechorin <ivan@pechorin.com> wrote in message news:<bgu8io$24fu$1@gavrilo.mtu.ru>...[color=blue]
> Amardeep Verma wrote:
>[color=green]
> > I would like to determine the Country and Organization from a given
> > IP.[/color]
>
> MaxMind provides free databases, derived from APNIC, ARIN, LACNIC, and
> RIPE WHOIS databases, and APIs for a number of languages, including Java.
>
> http://www.maxmind.com/
> http://www.maxmind.com/app/java[/color]
Roedy Green
Guest
 
Posts: n/a
#6: Jul 17 '05

re: How to determine the Country and Organization from IP


On Thu, 7 Aug 2003 22:12:27 +0100, "Michael Winter"
<M.Winter@(I_hate_spam)blueyonder.co.uk> wrote or quoted :
[color=blue]
>LACNIC (http://lacnit.net/) - Latin America and the Caribbean.[/color]

that should read http://lacnit.org

For future reference, various WHOIS lookups are indexed at
http://mindprod.com/jgloss/whois.html

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Roedy Green
Guest
 
Posts: n/a
#7: Jul 17 '05

re: How to determine the Country and Organization from IP


On Fri, 08 Aug 2003 21:23:58 +0100, Mark Thornton
<m.p.thornton@ntlworld.com> wrote or quoted :
[color=blue]
>Note that this does not reliably tell you where the user is located. For
>example I think it is AOL who use IP addresses from their US allocation
>for customers everywhere (in the UK for example).[/color]

For example, I looked up my own website's IP and discovered it was
allocated to "bigpipe". This is not me, and not my ISP but at least
one higher up the food chain.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Neomorph
Guest
 
Posts: n/a
#8: Jul 17 '05

re: How to determine the Country and Organization from IP


On Sat, 09 Aug 2003 01:40:11 GMT, Roedy Green <roedy@mindprod.com>
two-finger typed:
[color=blue]
>On Fri, 08 Aug 2003 21:23:58 +0100, Mark Thornton
><m.p.thornton@ntlworld.com> wrote or quoted :
>[color=green]
>>Note that this does not reliably tell you where the user is located. For
>>example I think it is AOL who use IP addresses from their US allocation
>>for customers everywhere (in the UK for example).[/color]
>
>For example, I looked up my own website's IP and discovered it was
>allocated to "bigpipe". This is not me, and not my ISP but at least
>one higher up the food chain. [/color]

You could do a reverse DNS call to at least get the full name of the
machine. This will give you a name that may tell you more.

It is basically impossible to get a true geographic location on every
machine through their IP number, though. You would have to equip each
machine with a GPS system that is always accessible through the internet
;-)

Cheers.
Roedy Green
Guest
 
Posts: n/a
#9: Jul 17 '05

re: How to determine the Country and Organization from IP


On Mon, 11 Aug 2003 13:24:00 +0200, Jacob <jacob@yahoo.com> wrote or
quoted :
[color=blue]
>I use http://www.all-nettools.com/cgi-bin/sw.cgi[/color]

that url did not work. Try this one.
http://www.all-nettools.com/tools1.htm
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Roedy Green
Guest
 
Posts: n/a
#10: Jul 17 '05

re: How to determine the Country and Organization from IP


[color=blue]
>
> Thank you guys for sharing your thoughts with me. IF you have
>anything more to add, please do post it.[/color]

Maybe there is some relative of PING you can use to find out where a
site is. Not every site would implement it. If not, maybe it is time
to invent such an identifying protocol, that would give you a vcard
for the IP. It might also present public keys for the site.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Amir Pashazadeh
Guest
 
Posts: n/a
#11: Jul 17 '05

re: How to determine the Country and Organization from IP


Hi,
use MaxMind GeoIP (http://www.maxmind.com/)

Amir Pashazadeh

"Amardeep Verma" <addverma@email.com> wrote in message
news:1a9170e5.0308070724.682929af@posting.google.c om...[color=blue]
> Hi,
> I would like to determine the Country and Organization from a given
> IP. I have to write a JSP, which when given the IP address gives the
> country and the organization to which the IP belongs. The organization
> may be the ISP, or a MNC or any other corporate/government body, or it
> may be of an individual. I have to do it progamitically from inside a
> JSP?
> Any suggestions anybody
>
> Thanks in Advance for your reply[/color]


Closed Thread