Link to home
Start Free TrialLog in
Avatar of multisites
multisites

asked on

Difference between IN A records and IN CNAME records

Hi:

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 200.157.211.200
ftp IN A 200.157.211.200
mail IN A 200.157.211.204
smtp IN A 200.184.161.136

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

www IN CNAME srv1.multisitesdominios.com.br.
ftp IN CNAME srv1.multisitesdominios.com.br.
mail IN CNAME srv2.multisitesdominios.com.br.
smtp IN CNAME srv6.multisitesdominios.com.br.

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.

Thanks.

Mario./
Avatar of Tintin
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 multisitesdominios.com.br points to srv1.multisitesdominios.com.br, 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 multisitesdominios.com.br 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 newdomain.org to newdomain.com. In the newdomain.org DB file, adding a line such as:  
    www   1D   IN   CNAME  www.newdomain.com.
    This line will make an alias from www.newdomain.org and point it at www.newdomain.com
"CNAME RRs incur performance overheads"
http://www.zytrax.com/books/dns/ch8/cname.html
http://www.zytrax.com/books/dns/ch8/a.html


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

ASKER

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 srv1.multisitesdominios.com.br. webmaster.multisitesdominios.com.br. (
     2007030422 ; serial
                3h           ; refresh
                1h            ; retry
                1w          ; expire
                1h           ; default_ttl
                        )
;
@                       IN NS   ns.multisitesdominios.com.br.
@                       IN NS   ns2.multisitesdominios.com.br.
;
localhost               IN A 127.0.0.1
@                       IN CNAME srv1.multisitesdominios.com.br.
ns              IN CNAME srv1.multisitesdominios.com.br.
ns2             IN CNAME srv2.multisitesdominios.com.br.
;
@                       IN MX   10 mail
;
www             IN CNAME srv1.multisitesdominios.com.br.
ftp             IN CNAME srv1.multisitesdominios.com.br.
mail            IN CNAME srv1.multisitesdominios.com.br.
smtpsrv         IN CNAME srv1.multisitesdominios.com.br.
smtp            IN CNAME srv1.multisitesdominios.com.br.
pop             IN CNAME srv1.multisitesdominios.com.br.
;
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 svr1.multisitesdominios.com.br.

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?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Tintin
Tintin

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