This is a discussion on Re: bind 9.3.2 linux utilities - DNS ; James M wrote: > anyone know of a command that will return all cname's for a given host? > or > is there possibly an api (perl or php) to do the same? > thanks > > this can only ...
James M wrote:
> anyone know of a command that will return all cname's for a given host?
> is there possibly an api (perl or php) to do the same?
this can only be done by looking at all your dns records
one set comes from A records to an ip-address
CNAME chains need to be followed
we run a locally developed script several times a day which downloads
and produces a set of web-pages including
* records pointing outside our site
* ip-addresses having multiple names (either A or CNAME)
In fact a file is produced with a line for each ip-address
the first name taken from PTR, other names capitalized when CNAME
* CNAME chains, sorted by length
* a page for each name-server mastering zones listing
when all dns comes from a system with a database backend
that system could provide such functionality without directly querying
of course there's no way to know if there's A or CNAME records
outside the dns we master/secondary.