• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 355
  • Last Modified:

when to use an a name vs. a c name?

When do you use an A name vs. a C name?

For instance, I want to forward webmail.domain.com to a different ip than domain.com. Do I create a new A Name record to do this or a new C Name record in DNS to accomplish this?

  • 2
2 Solutions
You need to create A record and MX record for this (mail exchange).
For details about CNAME, use the following
You will need to create a A record.

C name are use to points to a Domain name and A records points to an IP address

Exemple :
foo.example.com.        CNAME  bar.example.com.
bar.example.com.        A

Open in new window

I think your question is how to decide when I should use A / CNAME

This is just a question for yourself: how do you want to manage all your DNS entries? Do you change your servers often? (I mean, move to a new one with other IP)
It depends on what kind of service you host. Are they all on the same server? are you planning to separate these services on several servers? DNS-load-balance something on several servers ? and so on...

An example:
You have a server hosting many services (web, mail, ftp and so on), its IP is X.Y.Z.T
Usually, your create an A record for mydom.com pointing to X.Y.Z.T
And aliases for its different names : www => CNAME mydom.com ; ftp => CNAME mydom.com ; webmail => CNAME mydom.com and so on
Now imagine your hosting email services on it
I'd suggest you create an A record for mail.mydom.com, with the same IP as mydom.com
And CNAMEs for imap.mydom.com, pop.mydom.com, smtp.mydom.com and webmail.mydom.com pointing to mail.mydom.com
This way, you sort of "link" your mail-related DNS entries to the only server(=IP) hosting smtp+pop+imap+webmail. If your move these services to a new server, you just change the IP once, for mail.mydom.com.

=> The idea here is to declare A records and CNAME to this "A" for a consistent group of names/services.
Anyway, if you have a few records to manage, you just don't care :), provided DNS-propagation latency is not a major issue

I hope I'm clear enough
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now