Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How does a CNAME work?

cname
0
Posted

How does a CNAME work?

0

A CNAME lets you create a name that is an alias for another DNS name. For example, you create an “A” record for www.example.com, then create a CNAME called ftp.example.com and make it an alias for www.example.com. With this CNAME, everyone who accesses the ftp.example.com server will go to the IP address assigned to www.example.com. Once you create a CNAME for a particular domain name, you cannot create any other type of DNS record (MX, HINFO, NS,…) for that name, because it is not a “real” name – it is an alias for another name. A common technique for web sites is to add an “A” record for the domain itself, such as mywebsite.com, and make www.mywebsite.com a CNAME for mywebsite.com. Then web users can type either www.mywebsite.com or just mywebsite.com into their browser to reach the site. Note that you can not do the inverse, that is make mywebsite.com a CNAME for www.website.com, because mywebsite.com has an SOA record, and therefore cannot also have CNAME record.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.