473,770 Members | 2,144 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to determine the Country and Organization from IP

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
Jul 17 '05 #1
10 12373
Amardeep Verma wrote:
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


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 <gw*****@agrico reunited.com>

Jul 17 '05 #2
Amardeep Verma wrote:
I would like to determine the Country and Organization from a given
IP.


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

Jul 17 '05 #3
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_hat e_spam)blueyond er.co.uk
Remove "(I_hate_sp am)" to reply.

"Grant Wagner" <gw*****@agrico reunited.com> wrote in message
news:3F******** *******@agricor eunited.com...
Amardeep Verma wrote:
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


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 <gw*****@agrico reunited.com>

Jul 17 '05 #4
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 <iv**@pechorin. com> wrote in message news:<bg******* ****@gavrilo.mt u.ru>...
Amardeep Verma wrote:
I would like to determine the Country and Organization from a given
IP.


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

Jul 17 '05 #5
On Thu, 7 Aug 2003 22:12:27 +0100, "Michael Winter"
<M.Winter@(I_ha te_spam)blueyon der.co.uk> wrote or quoted :
LACNIC (http://lacnit.net/) - Latin America and the Caribbean.


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.
Jul 17 '05 #6
On Fri, 08 Aug 2003 21:23:58 +0100, Mark Thornton
<m.**********@n tlworld.com> wrote or quoted :
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).


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.
Jul 17 '05 #7
On Sat, 09 Aug 2003 01:40:11 GMT, Roedy Green <ro***@mindprod .com>
two-finger typed:
On Fri, 08 Aug 2003 21:23:58 +0100, Mark Thornton
<m.**********@ ntlworld.com> wrote or quoted :
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).


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.


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.
Jul 17 '05 #8
On Mon, 11 Aug 2003 13:24:00 +0200, Jacob <ja***@yahoo.co m> wrote or
quoted :
I use http://www.all-nettools.com/cgi-bin/sw.cgi


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.
Jul 17 '05 #9

Thank you guys for sharing your thoughts with me. IF you have
anything more to add, please do post it.


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.
Jul 17 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
9596
by: Lando Chez | last post by:
Hi I need a map of a country on which a region( part of the map) can be clicked ( or on mouseover) causing, on another part of the same page, the appearance of information regarding the region. I know how to show the information based on another part of the page, but I don't know how to make a map of a country clickable ( meaning, clicking different part of the map to show info on the page). How can I make a map of a country with...
1
10923
by: Steven T. Hatton | last post by:
I think Danny was one cup of coffee shy of full consciousness when he wrote this, but the gist of it makes sens to me: "C++ Project Organization Guidelines Last updated May 26, 2005. http://www.informit.com/guides/content.asp?g=cplusplus&seqNum=175 Last week's article about inline functions subtly brought into the limelight another important issue, namely how to organize the files of a typical C++ program, or project. This week I...
2
3557
by: Zyron | last post by:
Hello! I'm developing a web page that has a goal of providing personal content, which means that all information should be written in their own language. I'm about to finish my Geo targeting system that will identify where the users are coming from based on their IP address, and for this project I would really like to replace the English country list with a list of the country in the local language. I'm been around on
4
9487
by: Susanne Christe | last post by:
Hi all, I know how to use System.Globalization.RegionInfo, but I have problems to get the Numeric Country Code like this here: http://www.atmajaya.ac.id/Weblinks/KodeNegara.html ISO-3166. Do somebody know how to get them in C#.
2
1351
by: Patrick Blackman | last post by:
How do you determine the registered company on a computer? Thanks Patrick.
7
1923
by: Lloyd Dupont | last post by:
from the IP of the request ?
2
1398
by: Laszlo Csabi | last post by:
Anybody knows how can I determine client's location on an ASP.NET page? Laszlo
4
1970
by: steve_barker333 | last post by:
Hi guys, I'm designing a web-site that will allow users to look up other people, based on certain criteria. The most important criterion is geographical location. I've managed to find a really comprehensive country list (which is great), but I'm a little stuck as to what to do for the next level down in the hierarchy.
1
1296
by: mlh | last post by:
I'm using VBA and msXML to read response text from web page. Am having some problems. The 2nd Open-Get statement has a flawed URL. The first URL reaches a page that has a thousand or more buttons on it that bring up another page when clicked. It returns 250,000+ characters to strPageContent1. I would like to how to set up the 2nd URL string that takes me to the same page that clicking ONE of the buttons on the first page would. I just don't...
0
9618
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9906
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.