Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can I use nslookup to get all aliases for an IP?

17,381 views
Skip to first unread message

Owen Crow

unread,
Aug 21, 1997, 3:00:00 AM8/21/97
to

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

Cricket Liu

unread,
Aug 21, 1997, 3:00:00 AM8/21/97
to

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

Barry Margolin

unread,
Aug 21, 1997, 3:00:00 AM8/21/97
to

In article <33fc65e2...@news.omnes.net>, Owen Crow <oc...@slb.com> 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.

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.

David Lindes

unread,
Aug 22, 1997, 3:00:00 AM8/22/97
to

Stephen Sprunk wrote:
>
> Since having multiple CNAMEs in a response is invalid, BIND will never
> return more than one in a single query. You may be able to check with an
> AXFR, but remember that multiple CNAMEs is not technically legal and may
> not be supported n future versions of BIND.
>
> Stephen

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/

Morris Seals

unread,
Aug 24, 1997, 3:00:00 AM8/24/97
to

Hi Gang,
There is some new features to the DNS Boss software
product, I wanted to share with the newgroup. The GUI
now allows you to easily make a: DNS Primary, Secondary,
or Caching-only server. You can easily maintain many
domains with the tool.
The web site is: http://www.dnsboss.com

Thanks,
Morris
se...@dnsboss.com

Ron Procopio

unread,
Aug 24, 1997, 3:00:00 AM8/24/97
to

Barry Margolin wrote:
>
> In article <1997082216...@daveltd.mtv.aw.sgi.com>,

> David Lindes <bind-irix-po...@daveltd.com> wrote:
> >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...
>
> I doubt that this is likely. He didn't give many details about the
> context, but my guess is that he's trying to find all the www.XXX.com
> aliases that point to a web server he operates, so when he moves the server
> to a new machine he can update all the aliases.

>
> --
> 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.


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.

proc...@ims.advantis.com

0 new messages