Getting a full list of CNAMEs and A records from DNS

Corey Edwards tensai at
Fri Dec 7 16:43:28 MST 2007

On Fri, 2007-12-07 at 15:57 -0700, Dave Smith wrote:
> I have a rather unique problem where I need to construct a full list of 
> CNAMEs (aliases) and A records (official names) when given a single host 
> name. For example, if foo is a CNAME for bar, and biz is a CNAME for 
> baz, and baz is an A record, and I was given "biz", I would want to show 
> that "baz" is the primary host, and "foo", "bar", and "biz" are all 
> aliases for it.
> Is this possible to do with tools like gethostbyname() or some other 
> library? Or would this require an entire zone transfer (AXFR)?

AFAIK the only way to find CNAMEs for a host is with a zone transfer.


More information about the PLUG mailing list