CNAME vs A records

domain-name-system

I built a small rails app that allow users to make a simple site. It uses subdomain accounts ex: deb.myapp.com

Whenever an user wanted to have a domain name associated with their site, they would change their NS records to point to slicehost where the application is hosted and I would manage the DNS records myself.

However, as more people are using the application this is not an option for me anymore.

I prefer users to keep their nameservers at goddady, register.com, etc, so they can log in and manage their own MX records or whatever else they need to change.

My question is, should I have them change the A records to point to my server's ip, or should I have them create a CNAME record? Do they need to delete the default A records to allow the CNAME record to work? Will the A record take precedence and overrule the CNAME record?

Thanks in advance. Sorry if this is a very basic question. I've read other posts and I can't find a definite answer.

Best Answer

A CNAME Record must be the only record for a DNS Record. Most common gotcha is that you can not create a CNAME for mysite.com since you also have a NS Record and most likely a MX record for that name.

As long as you have singular occurrences of names I would recommend using CNAME since it makes you more flexible. When you migrate to another server you would just have to take care of changing the name that all CNAMEs point to.