Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Querying DNS for CNAMEs for a server

I have an interesting problem, given a FQDN, how do you find all its alias names WITHOUT having access to the DNS files or being able to list the domain (zone)?

The issue is restricted to all aliases within a single domain.

share|improve this question

marked as duplicate by sysadmin1138 Sep 6 '11 at 21:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

AFAIK you can't - There is no reliable way to know how many CNAMEs point to a given hostname. DNS does not have a link/reference count like a filesystem does.

Restricting the problem to a single domain makes it more plausible, but still not really possible within the constraints you provided in your question:

  • If you can do an AXFR of the domain (dig -t AXFR you'll get a dump of all the records, and you can parse them.
  • Alternatively you can examine the zone file if you have access to it.

If neither of those is an option, or if you're not restricting yourself to a single domain the problem is effectively unsolvable - it's like asking how many people in the world used the word "wombat" today.

share|improve this answer

You cannot find this information without a copy of the zone.

About the closest thing you could do is to just capture the data in logs or in a packet capture if the name is included as part of the protocol (ie http name-based hosting).

share|improve this answer
drat...I suspected as much...thought that I might have missed some cool utility to do this. – mdpc Sep 6 '11 at 20:48
the only tool that I can think of that may help is dig -t AXFR (see my answer), but that requires the server to allow the transfer, which is unlikely these days... – voretaq7 Sep 6 '11 at 20:52

Not the answer you're looking for? Browse other questions tagged or ask your own question.