My apologies in advance if this is a common question, or if I have
used improper terminology. I searched on DejaNews and scanned
throught the O'Reilly book, but couldn't find anything.
Owen Crow - Unix Systems Administrator
In general, you can't do this. DNS doesn't maintain any pointers back
to an alias from the canonical name.
You could approximate this by reverse mapping the IP address to a
domain name, then listing the zone the domain name is in for CNAME
RRs, and comparing the target of the CNAME RRs to the canonical name.
But that's ugly.
cricket
Acme Byte & Wire | http://www.acmebw.com/
cri...@acmebw.com | (303) 449-0484
If you administer DNS for all the relevant domains, you can just search for
the CNAME records in your zone files using grep.
If some of the aliases are in domains managed by others, there's no lookup
that will do it. You need to keep good records. There's nothing in DNS
that keeps track of the inverse of CNAME records the way PTR records are
the inverse of A records. And even if there were, someone would have to
ensure that they're kept up to date, which is the problem you're trying to
solve.
--
Barry Margolin, bar...@bbnplanet.com
BBN Corporation, Cambridge, MA
Support the anti-spam movement; see <http://www.cauce.org/>
Please don't send technical questions directly to me, post them to newsgroups.
I think he was talking about having multiple CNAME entries that
pointed various names to one canonical name, which is certainly
legal. Something like:
relay CNAME someserver
mailhub CNAME someserver
dnssrv CNAME someserver
> At 16:14 08-21-97 GMT, you wrote:
> >I need to be able to display the main entry and all CNAMEs for a
> >particular IP address. We often move the functions of a server from
> >one IP to another and then reassign the necessary alias to get client
> >computers to point to the new server. I need a way of making sure
> >there are no left-over aliases after a move.
> >
> >My apologies in advance if this is a common question, or if I have
> >used improper terminology. I searched on DejaNews and scanned
> >throught the O'Reilly book, but couldn't find anything.
> >
> >Owen Crow - Unix Systems Administrator
As for this, as has been said, there's no easy way within
nslookup, to do it, but if you can be sure that all the CNAME
records are in the same zone, you can grep pretty easily from
the zone file itself, or from dig output...
e.g.:
dig @server zone.domain.com axfr | grep 'CNAME canonname'
where the whitespace between CNAME and the canonname is a tab,
not spaces.
Works for me... at least using the dig from bind 8.1.1...
Hope that helps...
David
--
David Lindes, KF6HFQ DaveLtd[tm] Enterprises
lin...@daveltd.com http://www.daveltd.com/
Thanks,
Morris
se...@dnsboss.com
If he only need to change the IP of his server and not the name then
he doens't need to know all the aliases. The whole point of using
aliases is so that you only need to change the A record and the PTR
record to change the IP of all the aliases.
If however he changes the name that all the aliases point to then he's
got a problem. If he controls all the zone file then yes a grep should
work. Another way is that if he is informed of each alias as it's
created is to make notes in the zone file itself.