I'm doing a big reshuffle of our websites and hosting, moving about 10 domains to a new server. In doing so I had to make some changes to the DNS, pointing all of the domains at the new server.

Instead of pointing all of the DNS records at the IP address if the server I used a CNAME entry to point them at an A entry for the IP adress... if that doesn't make sense take a look at this:

server1 A

@   CNAME server1.mycompany.com.
*   CNAME server1.mycompany.com.
www CNAME server1.mycompany.com.

@   CNAME server1.mycompany.com.
*   CNAME server1.mycompany.com.
www CNAME server1.mycompany.com.

@   CNAME server1.mycompany.com.
*   CNAME server1.mycompany.com.
www CNAME server1.mycompany.com.


Hopefully you'll see what I'm trying to do, to keep things tidy I have set a single A record to the servers IP address, and used CNAME records to point all of the other domains to it. This means if the IP has to change I only have to change it once, it also means I can easily tell where each record is pointing to, as some point to server2.mycompany.com and server3.mycompany.com etc.

Now we had a problem with our email this morning, whereby a recipient email server could not authenticate our mail server, email was rejected. I changed the @ record on our mail.domain1.com domain from CNAME server1.mycompany.com to the IP and the email was sent successfully.

Question, despite being nice and readable, is there a reason I shouldn't be using CNAME to point to another DNS record. I believe @ is for the domain itself (i.e. domain1.com). It seemed that setting @ to a CNAME messed around with our email, but are there any rules as to when I should be using it?

Many thanks, Ben

  • You cannot CNAME the domain itself, since it also contains SOA and NS records. – user1686 Feb 7 '11 at 20:59

It's an RFC violation to use a CNAME as an MX record. From RFC2181 section 10.3:

The domain name used as [...] part of the value of a MX resource record must not be an alias. [...] It can also have other RRs, but never a CNAME RR.

In practice it will often work, but some MTAs are aware that you shouldn't do it, so assume they can ignore you or misbehave when they're fed one.

  • CNAME can't point to another CNAME
  • PTR, SRV, NS, MX can't point to CNAME
  • CNAME must have no other record

Use CNAME for all, except MX, NS and SRV.


CNAME are often avoided for performance reasons : it forces the client to ask a second question to the DNS server, leading to higher latency for the client and more load on the DNS server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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