« 20 New Rules for Faster Web Pages | Main | Amazon Announces Static IP Addresses and Multiple Datacenter Operation »

How to Get DNS Names of a Web Server

For some special reason, I'm trying to make a web server able to get all the DNS names mapped to its IP. Let me explain more, I'm creating a website that will run in a web farm, every web server in the farm will have some subdomains mapped to its ip, what I want is that whenever my application starts on a web server is to be able to get all the subdomains mapped/assigned to that server, e.g. sub1.mydomain.com, sub2.mydomain.com. I understand that I have to use reverse dns lookup (i.e. give the IP get the domain name), but I also want to get all the subdomains not just the first one that maps to that IP. I've been reading about DNS on the internet but I don't seem to find any information on how to achieve what I want, normally you use dns to get the ip of a domain but I'm not sure that all servers enable reverse lookup.

The problem is that I'm still not sure whether I'll host my own DNS server or use the services of some company (many companies offer DNS hosting services), so, my question is:

- If I host my own DNS server, will it be possible to get all the subdomains using reverse lookup? Another question here, if I enable reverse lookup on my DNS server, can this have any negative side effects? As to security .. etc .. is there any way I can enable only my web servers to do reverse lookup while preventing anybody else on the internet from using reverse lookup?

- If use the DNS hosting services of some company, will I be able to do what I want? ie. get the subdomains mapped to the IP address of a web server?

Unfortunately I don't have much experience with working with web farms, so I would like also to ask whether every web server in the web farm gets its own static IP or how does it work? I mean you have the firewall ... etc .. so I don't know how IP assignments works in a web farm scenario ..

Thanks a million in advance and sorry for my really long post ..


Reader Comments (2)

Yahoo Site Explorer (http://developer.yahoo.com/search/siteexplorer/) has an API that might work.
Here's a script: http://www.freebsdhowtos.com/62.html.

Though I tend to think what you are trying to do is off somehow, but it's difficult to tell from your post. This RightScale http://blog.rightscale.com/2008/03/26/dns-elastic-ips-and-how-things-fit-together-when-upgrading-a-server/">post does a good job explaining how IPs could be used.

November 29, 1990 | Unregistered CommenterTodd Hoff

Thanks a lot for reply, I'm going to check those links .. you say that there's something wrong with my post, please tell me and I will explain in more detail .. the basic idea as mentioned in the post is to get all the dns names for a server (this is plural so the problem is not to get the first dns name, I want all of them otherwise it's useless) ..

November 29, 1990 | Unregistered CommenterWaleed Eissa

PostPost a New Comment

Enter your information below to add a new comment.
Author Email (optional):
Author URL (optional):
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>