WWW On Your Domain: DNS CNAME and A Record


Let's say you just bought a domain: mycoolnewdomain.com

You're most likely going to want both www.mycoolnewdomain.com AND mycoolnewdomain.com to point to your website.

This is messed up quite frequently to where one of those options points to a sad blank page but its quite simple to set up.

It takes just two DNS Records: an A Record and a CNAME Record

A Record

What is an A record? It basically helps the internet find an IP Address. Somewhere in the world there is a computer connected with a not so easy to remember number (something like 11.111.11.111) that brings up your website. Setting up this record "points" this name to that number so that the world can find you at mycoolnewdomain.com

Depending on your domain name provider the interface will vary but the values will be as follows:

Record Type Host Value
A mycoolnewdomain.com 11.111.11.111


CNAME Record

What is a CNAME (Canonical Name) record? It points one name to another, and it has to point to a domain name, not an IP address.

In our example we are "creating" a new name www.mycoolnewdomain.com and pointing it to mycoolnewdomain.com so that the website comes up no matter which name is used in the browser.

Depending on your domain name provider the interface will vary but the values will be as follows:

Record Type Host Value
CNAME www mycoolnewdomain.com


TL;DR

To set up your DNS CNAME and A Record so that your website works with and without "www", you'll want to make sure your DNS panel has the two following records

*values are based on the example detailed above, it's not the exact solution

Record Type Host Value
A mycoolnewdomain.com 11.111.11.111
CNAME www mycoolnewdomain.com


Archive