LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-10-2006, 07:10 AM   #1
rigel_kent
Member
 
Registered: Nov 2004
Posts: 64

Rep: Reputation: 15
IP to Domain


Hi,

Does anyone knows how to find the domain name given an IP address ( in Perl )? The reverse DNS gives the remote address computer of the hosting company.

Kind regards,

Rigel_kent
 
Old 05-10-2006, 08:21 AM   #2
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
It depends on how the DNS records are set, if there is no reverse record for the ip, then you simply cannot backtrack it. So, you'd have to go fixing the DNS first, then using reverse dns queries.
 
Old 05-10-2006, 09:13 AM   #3
RipClaw
LQ Newbie
 
Registered: Oct 2005
Distribution: PCQ Linux 2006
Posts: 19

Rep: Reputation: 0
One important thing to note is that many webservers support "Name-based" virtual hosting.
This means all the websites will have the same IP@

For eg.
www.site1.com , 10.10.10.10 , /home/guy1/public_html/index.html
www.site2.com , 10.10.10.10 , /home/gal3/public_html/index.html

The server identifies the requested site's www directory by the name & not by the IP@
This is a common technique used by many free webspace providers.
For websites like this, typing the IP@ in the browser, wont return the expected website!!!

Last edited by RipClaw; 05-10-2006 at 09:16 AM.
 
Old 05-11-2006, 03:44 AM   #4
Spudley
Member
 
Registered: Mar 2003
Location: Berkshire, England.
Distribution: SuSE 10.0
Posts: 299

Rep: Reputation: 32
Since a given IP address can have any number of domain names attached to it, you can't simply start with an IP address and hope to get a domain name at the end.

Fortunately, domaintools.com offers a service that may be close to what you're after.

For instance, try this link: http://whois.domaintools.com/linuxquestions.com
You'll see info about this site, most of which you won't be interested in. But if you scroll down a bit, you'll see a link which reads "145,444 other sites hosted on this server". You have to register with them to use the feature, but once you've registered, you can click on that link and get a list of all domains on a server.

The downside is that you have to start with a domain name; starting with an IP address doesn't work. But once you've got one name for the server, you should be able to use this tool to find out all the others.

The link isn't there for all domains, and I haven't actually tried the tool myself, and I know it doesn't answer your question about writing it in Perl, but it's as close as I can find to what you're after.

Hope that helps
 
Old 05-12-2006, 03:29 AM   #5
rigel_kent
Member
 
Registered: Nov 2004
Posts: 64

Original Poster
Rep: Reputation: 15
Hi,

Thanks to all.

Regards,

Rigel_Kent
 
  


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
DHCPD is updating BIND with <host>.<domain>.<domain>. diabelek Linux - Networking 15 10-11-2007 05:58 AM
what would make ever virtual domain name resolve to one domain name on my system kuplo Linux - Newbie 1 11-14-2005 06:57 PM
Cant get entry in bind to work with domain.com instead of www.domain.com pxes351 Linux - Networking 12 05-09-2005 06:20 AM
Sendmail sending as host.domain.com, i want it to be from just domain.com. PlatinumRik Linux - Software 5 10-07-2004 04:32 PM
Joining a machine from another domain to my linux samba domain acummins Linux - Networking 0 09-13-2003 07:07 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:15 AM.

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