Link to home
Start Free TrialLog in
Avatar of multisites

asked on

Difference between IN A records and IN CNAME records


I need to solve a real doubt before making modifications at my DNS in a Linux Server.

All my domains files at /var/named have lines like these:

www IN A
ftp IN A
mail IN A
smtp IN A

I was asked by the ISP to modify them to some like these:


They say that in this way I will not be dependent on any IP modification they do. My questions:

No problem about this? Wouldn't my DNS work more slowly? Please I would like to know, technically, what is the difference between "IN A" records and "IN CNAME" records.


Avatar of Tintin

A CNAME is is simply an alias.  A CNAME has to point to a valid A record.

The one thing you shouldn't do is have a MX record pointing to a CNAME.  MX records should only point to an A record.

In your case, the MX record for points to, so that's fine.

As for whether the DNS will work more slowly or not, it depends on how DNS is setup.

If your server is authoritive for the domain, then you'll have an A record for svr1 and svr2, so there will be no speed difference.

CNAME:  The CNAME in the DB file creates an alias to an address.
    Example:  Pointing a domain such as to In the DB file, adding a line such as:  
    www   1D   IN   CNAME
    This line will make an alias from and point it at
"CNAME RRs incur performance overheads"

When I mentioned there wouldn't be any speed difference, I was referring to the apparent speed for an end user.  As nedvis has pointed out, there is an additional overhead on the DNS server, but unless your DNS server is very unpowered and/or being constantly sustaining a high number of queries, there shouldn't be any noticeable speed difference.
Avatar of multisites


Hi Tintin and Nedvis:

Well, so that you can tell me if everything is OK, this is as a tipical domain file at my Server will be after modification. Do both of you think it is ok?

$TTL 1h
@         IN SOA (
     2007030422 ; serial
                3h           ; refresh
                1h            ; retry
                1w          ; expire
                1h           ; default_ttl
@                       IN NS
@                       IN NS
localhost               IN A
@                       IN CNAME
ns              IN CNAME
ns2             IN CNAME
@                       IN MX   10 mail
www             IN CNAME
ftp             IN CNAME
mail            IN CNAME
smtpsrv         IN CNAME
smtp            IN CNAME
pop             IN CNAME
As explained in my first post, MX records should *not* point to CNAMES.

So where you have

@                       IN MX   10 mail

this should be

@                       IN MX   10

Hi, Tintin, please just let me know the reason. Doesn't it work at all, does it have performance problems or does it have security issues?

Avatar of Tintin

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial