• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1072
  • Last Modified:

DNAME aliases all hosts except domain's root record

I'm using BIND9, and I've got two domains, one of which I would like to completely alias to the other. For the sake of agrument, we'll call them domain.com, and domain.be. I've got multiple "A" records in the domain.com zone, and only one record in the domain.be zone, a DNAME pointing to domain.com.

blah1 IN A
blah2 IN A
blah3 IN A

IN DNAME domain.com.


This all works fine, I get responses when looking up blah1/2/3.domain.com, and blah1/2/3.domain.be. HOWEVER, I do NOT get a response when looking up domain.be (i.e., without a hostname, just the domain). Should this DNAME not alias the root record (RR) to domain.com as well? If not, why? And if it IS supposed to, any clue why it's not?

Also, if this is a normal occurrence, is there any way to alternatively point domain.be to domain.com, while keeping the DNAME in order to keep the dynamic aliasing?
1 Solution
Chris DentPowerShell DeveloperCommented:

I believe this is behaviour by design. DNAME exists to map a subtree to a different zone.

Your need for it to map a record at the same level as the DNAME is not discussed at all.


References: http://www.ietf.org/rfc/rfc2672.txt
DNAME is a macro option (used by BIND) to synthesize CNAME RRs (RESOURCE records, no such thing as ROOT record)
CNAME records in turn do not work for SMTP (both MX and A fallback)
And for NS server names.
For DNS testing it would be useful if you tell your domain name and NS IPs so that we can test.

PS you cannot avoid setting at least 2xNS records for each domain name (one of them for 2nd time in SOA)
PPS for web you need named virtual host and redirect.
SirParadoxAuthor Commented:
I am aware that CNAME and DNAME can do sub domain elements, but is there a method to map an entire zone including the base domain (A, MX, NS) to another zone? Maybe in the BIND config somehwhere?
Jan SpringerCommented:
Yes.  In your named.conf zone section for domain.be, use the master file domain.com.

@        IN             A          <IP of domain.com>
host1    IN            A          <IP of host1>
host2     IN           CNAME   host2
host3    etc.
You can use same zone file for other domains.
i.e DNS on old names/addresses, considerations for other services already mentioned.

Featured Post

SMB Security Just Got a Layer Stronger

WatchGuard acquires Percipient Networks to extend protection to the DNS layer, further increasing the value of Total Security Suite.  Learn more about what this means for you and how you can improve your security with WatchGuard today!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now