Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

assume I have a domain with the following RRs:

domain.com.    IN A
domain.com.    IN MX      mail.domain.com.         10
*              IN MX      othermail.domain.com.    10
*              IN CNAME   domain.com.
mail           IN A

I hoped this would allow me to server web pages and receive mail on any subdomain of domain.com but when I test it:

~# dig blah.domain.com MX

; <<>> DiG 9.4.3-P1 <<>> blah.domain.com MX
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12815
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 2


blah.domain.com.    84770	IN	CNAME	domain.com.
domain.com. 	83445	IN	MX	10 mail.domain.com.

I would expect to get an answer section like so:

blah.domain.com.    84770	IN	MX	10 othermail.domain.com.

But it seems that I get the CNAME wildcard record instead of the MX.

From reading various things I found online it seems to me that this behaviour is by design (however braindead it may be).

Now my question is if it is possible in any way to have a configuration like this returning different anserws based on the record type?


share|improve this question

1 Answer 1

up vote 0 down vote accepted

It's perfectly possible to mix wildcard RRs of different types.

What you can't do is mix a CNAME RR with any other sort of RR (DNSSEC RRs excepted). That applies whether the RRs are wildcarded or not.

In your case what you need to do is replace the CNAME RR with an A RR, pointing at the same IP address as the main domain:

$ORIGIN example.com
@         IN A
          IN MX 10  mail
*         IN A
          IN MX 10  othermail
mail      IN A
othermail IN A
share|improve this answer
Ok, thanks. I was under the impression that it's not advisable to have multiple A records pointing to the same IP? –  UloPe Jul 13 '09 at 14:58
multiple A's pointing to the same IP is perfectly normal. –  Alnitak Jul 13 '09 at 15:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.