Does "@" in CNAME record not work?

Joseph S D Yao jsdy at cospo.osis.gov
Thu Jul 12 20:22:03 UTC 2001


On Thu, Jul 12, 2001 at 02:03:02PM +0000, Jim Lum wrote:
> I'm setting a nameserver using Bind on my home network.
> 
> I have a server running both my web server and Bind (i.e., the name
> server and the web server are on the same machine).
> 
> In the Bind zone file, I have the name server named as 'ns1', i.e., I
> have an 'A' record:
> 
> ns1	A	192.168.0.4
> 
> And, for the web server, I have a CNAME record:
> 
> www	CNAME	ns1
> 
> But, I also wanted to be able to be able to have just the domain name
> (the origin, I guess it's called), so I added an additional CNAME
> record:
> 
> @	CNAME	ns1
> 
> When I do this, it doesn't work.  When I ping 'mydomain.com', instead of
> picking up the IP address for ns1.mydomain.com that I have set in my
> Bind files, it's getting some other IP address.
> 
> If I replace the @ CNAME record with:
> 
> mydomain.com.	CNAME	ns1
> 
> it works correctly.
> 
> Is the "@" notation not allowed in CNAME records?

It's a surprise to me that the notation is not allowed.  But it is
standard that any name that appears on the left of ANY OTHER record may
not appear on the left of a CNAME record.  The current domain name ("@")
is usually to the left of an SOA and/or NS record.  So it may not
appear, in "@" or any other form ["mydomain.com."], to the left in a
CNAME record.

You must be using an old version of BIND, if it even let you do
something like the above!

-- 
Joe Yao				jsdy at cospo.osis.gov - Joseph S. D. Yao
OSIS Center Computer Support					EMT-B
-----------------------------------------------------------------------
This message is not an official statement of COSPO policies.


More information about the bind-users mailing list