Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

assume I have a domain with the following RRs:    IN A    IN MX         10
*              IN MX    10
*              IN CNAME
mail           IN A

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

~# dig MX

; <<>> DiG 9.4.3-P1 <<>> 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


;; ANSWER SECTION:    84770	IN	CNAME 	83445	IN	MX	10

I would expect to get an answer section like so:

;; ANSWER SECTION:    84770	IN	MX	10

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

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