CNAME Record

A CNAME (Canonical Name) record maps an alias domain name to a different, canonical domain name. The DNS resolver follows the CNAME target and returns whatever records exist at the canonical name.

How CNAME Records Work

When a resolver queries a name that has a CNAME record, it does not get an IP address directly. Instead, it gets the canonical name and must perform a second lookup to resolve that name to an address. This creates a lookup chain.

blog.example.com.   CNAME   example.github.io.
example.github.io.  A       185.199.108.153

In this example, a query for blog.example.com returns the CNAME pointing to example.github.io. The resolver then queries for the A record of example.github.io and returns that IP to the client.

When to Use a CNAME

Restrictions

Common Mistakes

Look up CNAME records for any domain

Open DNS Lookup

Look up CNAME records with the DNS tool →