LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   IP to Domain (https://www.linuxquestions.org/questions/programming-9/ip-to-domain-443412/)

rigel_kent 05-10-2006 07:10 AM

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

Artanicus 05-10-2006 08:21 AM

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.

RipClaw 05-10-2006 09:13 AM

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!!!

Spudley 05-11-2006 03:44 AM

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 :)

rigel_kent 05-12-2006 03:29 AM

Hi,

Thanks to all.

Regards,

Rigel_Kent


All times are GMT -5. The time now is 04:49 PM.