SirParadox
asked on
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.
i.e.:
========================== ========== =====
domain.com:
IN A 123.45.67.89
blah1 IN A 123.45.67.89
blah2 IN A 32.12.34.53
blah3 IN A 93.56.62.34
domain.be:
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?
i.e.:
==========================
domain.com:
IN A 123.45.67.89
blah1 IN A 123.45.67.89
blah2 IN A 32.12.34.53
blah3 IN A 93.56.62.34
domain.be:
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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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?
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.
@ 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.
i.e DNS on old names/addresses, considerations for other services already mentioned.
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.