LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-09-2004, 11:23 PM   #1
myself_rajat
LQ Newbie
 
Registered: May 2004
Location: India
Posts: 21

Rep: Reputation: 15
Exclamation Help needed regarding DNS server query


Dear All,
I want to know about DNS server queries, and what are all information we can get it from a DNS server. Actually I am intrested in finding the region of given IP address.

What I need to do now is to identify the given IP address is from which country.
For This I need to determine the IP ranges allotted be country as well as the domain extensions (say .co.in for India). Then I will keep this information in a table.
So that against a given IP address I can search the table, and can identify it country and region.

So now, I want to know from where I can get this information about IP address ranges and domain extenstion, to store in table. Do you have any idea.

Waiting for some +ve responses.
 
Old 08-10-2004, 04:59 AM   #2
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 50
Hey Rajat, this answers your question in part

http://www.komar.org/cgi-bin/ip_to_c...show_all_flags

http://ip-to-country.webhosting.info/node/view/55

Here is the IP-to-Country database.

Last edited by ppuru; 08-10-2004 at 05:17 AM.
 
Old 08-10-2004, 08:29 AM   #3
myself_rajat
LQ Newbie
 
Registered: May 2004
Location: India
Posts: 21

Original Poster
Rep: Reputation: 15
Thanks puru,
Really its the exact information what I needed. Thanks again.
 
Old 08-11-2004, 06:06 AM   #4
myself_rajat
LQ Newbie
 
Registered: May 2004
Location: India
Posts: 21

Original Poster
Rep: Reputation: 15
Hi Puru,
One another way is also possible to get the location of a given IP address. We can query the "whois server" and get the information in its response.
Do you know the query format and how to parse the response at client side to get the relevent information.
 
Old 08-11-2004, 06:12 AM   #5
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 50
are you looking for

whois <ip adress> @whois.<area managers>.net

The area managers can be arin or ripe or apnic or ...
 
Old 08-11-2004, 06:16 AM   #6
myself_rajat
LQ Newbie
 
Registered: May 2004
Location: India
Posts: 21

Original Poster
Rep: Reputation: 15
ya exactly........but how can I get this information at IP. I mean can you tell me the query packet format and response format, as well as how to parse the received response(Usage of whois protocol).
 
Old 08-11-2004, 06:31 AM   #7
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 50
whois.arin.net is kind enough to point you to the appropriate area manager in case it does not own the IP range.

Try
whois 64.179.4.147 @whois.arin.net

Similarly, try to whois your WAN IP at the arin whois servers.
 
Old 08-11-2004, 08:18 AM   #8
myself_rajat
LQ Newbie
 
Registered: May 2004
Location: India
Posts: 21

Original Poster
Rep: Reputation: 15
ya that is okay....actually I want to implement the same kind of service, which can be able to provide the location of a given IP address. So for that I need to query the whois server, thats why I want to know abut the query and response packet structures etc.
 
Old 08-16-2004, 06:09 AM   #9
myself_rajat
LQ Newbie
 
Registered: May 2004
Location: India
Posts: 21

Original Poster
Rep: Reputation: 15
hi,
I made some queries to the whois servers, but whatever response I got is in human readable text formate. More over the response format of each server is of different form. So I was not able to parse it and get the relevent information.

I searched the net, that if we can get the response in proper xml format. So that I can easily parse it. I got one mail in a message archive, in that it was stated that if we sand whois query in XML format then will get the response in XML format only. Other wise simple text response will be returned.

Does any body know that how we can query the whois srevr in xml format??
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
help needed to setup a DNS server can anyone say how to configure a DNS server subha Linux - Networking 4 04-27-2012 11:50 PM
Help needed: DNS server setup phonecian Linux - Networking 1 01-28-2005 05:43 PM
Clients won't query DNS server BruceC Linux - Newbie 3 10-06-2004 08:43 AM
Internal DNS server needed?? jme Linux - Networking 5 09-30-2004 06:53 PM
DNS query chynna_v Linux - Newbie 1 09-15-2004 04:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration