DNS Tools

CNAME Lookup

Check the canonical alias for a hostname.

A CNAME record makes one name an alias of another. CNAME is short for canonical name: the record says that the real, canonical name for www.example.com is something else, and that anyone asking about the alias should use the records of that other name.

This tool looks up the CNAME record of a hostname and shows the name it points to. If the hostname is not an alias, the result is empty.

How to check a CNAME record

  1. Type the full hostname into the field, including the subdomain: www.example.com, shop.example.com or blog.example.com.
  2. Click Lookup. The tool always asks for the CNAME type, so there is nothing else to choose.
  3. Read the three summary rows: Domain, Record type and Records found.
  4. Look at the DNS records table. The Value column holds the target, the name that the hostname you entered is an alias for.

The example on the page is www.github.com. A www name is a sensible first test, because many sites make www an alias of the main domain or of a hosting service.

A web address works as input too. The tool keeps the hostname and drops the rest. Names that begin with an underscore, such as selector1._domainkey.example.com, are accepted, which matters because email services and some verification methods use CNAME records on such names.

How to read the result

Part of the resultWhat it shows
DomainThe hostname you asked about
Record typeCNAME
Records foundNormally 1 when the hostname is an alias and 0 when it is not
ValueThe target name that the alias points to

A name can have only one CNAME record, so a normal result has a single row. The target is always a hostname. It is never an IP address and never a web address with https:// or a path.

When the hostname has no CNAME record, the page says "No records were returned." This is not an error. The name may still have A or AAAA records and work normally, and Hostname to IP shows those addresses.

The target often tells you which company is behind a subdomain. A target under the domain of a hosting platform or a shop system shows where that part of the site runs, even when the address bar only ever shows your own domain.

What an alias does

When a resolver looks up a name and finds a CNAME record, it drops the original question and starts again with the target name. It does this for every record type. A resolver that asks for the address of shop.example.com and learns that the name is an alias of stores.example.net goes on to fetch the address of stores.example.net and returns that.

The benefit is that the owner of the target can change its addresses at any time. A hosting company can move servers or switch networks, and every customer whose name is an alias follows along without editing a record.

A CNAME changes only where DNS points. It is not a redirect. The browser still shows the original name, still sends that name to the server, and still expects a certificate issued for that name. Pointing a CNAME at a service is therefore only half of the setup. The service also has to be told to accept your hostname, usually through a setting called "custom domain".

Typical uses

AliasTargetPurpose
www.example.comexample.comKeep www on the same server as the main domain
shop.example.comstores.example.netPut a subdomain on a hosted shop or site builder
cdn.example.comexample.cdn.example.netDeliver files through a content delivery network
selector1._domainkey.example.comselector1.mail.example.netLet an email service publish and renew a DKIM key

In each row the domain owner hands one name over to the DNS of another party. Whatever the target points to is what visitors of the alias receive, so a CNAME should only point at a name you have reason to trust.

Why a name with a CNAME cannot have other records

The DNS rules say that a name with a CNAME record may not hold any other record. The reason follows from how aliases work. A CNAME tells resolvers to take everything from the target, so a second record on the alias would contradict it.

  • A hostname cannot have both a CNAME and an MX record. If example.com were an alias, it could not receive mail under MX records of its own.
  • A CNAME and a TXT record cannot share a name either. Verification strings and SPF records need a name that is not an alias.
  • The top of a domain, such as example.com without www, cannot normally be a CNAME. That name has to hold the NS and SOA records that define the domain, and those would clash with an alias.

For this reason a lookup of a bare domain is normally empty. Hosting services that only hand out a hostname work around the limit in two ways. Some ask you to use www and redirect the bare domain to it. In other cases the DNS provider offers a special record, often called ALIAS, ANAME or CNAME flattening. With that feature the provider looks up the target itself and answers with ordinary A and AAAA records, so this tool shows no CNAME for such a name even though the control panel lists one.

MX and NS records have a related rule in the other direction: they must not point to a name that is an alias. If a mail server name returns a CNAME here, change the MX record so that it uses the final name.

Chains of CNAMEs

A target can itself be an alias of a third name. Content delivery networks do this often and pass a name through two or three of their own hostnames before an address appears. Resolvers follow the chain to its end.

To trace a chain, look up the target shown in the Value column, and repeat until the result comes back empty. The last name is the one that holds the addresses.

Every step is one more question a resolver may need to ask, and one more record that somebody can break. Keep your own chains short by pointing the alias straight at the final name the provider gave you. A chain that loops back on itself never resolves.

Dangling CNAMEs

A dangling CNAME is an alias whose target no longer exists. It is what remains when a service is cancelled and nobody deletes the DNS record that pointed to it. The subdomain stops working, which is harmless by itself.

The risk comes later. On many platforms the target name is tied to an account or a resource name that becomes free again after cancellation. Someone else can claim that name, and from that moment your subdomain shows their content under your domain. This is known as a subdomain takeover.

Checking for it takes two lookups. Run the subdomain through this tool and note the target. Then look up the target with Hostname to IP. No addresses means the alias points at nothing. If the target does have addresses, HTTP Status shows what the subdomain answers with, and a 404 status from the platform suggests that the service behind it is gone.

Delete a CNAME record in the same step as you cancel the service it points to.

What this tool does not show

The tool reports the CNAME answer for the name you enter. It does not resolve the target to an address, does not test whether the target still exists and does not check that the service at the other end accepts your hostname.

It shows no TTL values and does not validate DNSSEC. Records created through ALIAS or flattening features do not appear, because in public DNS they are address records.

The query runs on the IP Tracker server and goes to public resolvers run by Cloudflare, Google and Quad9. The first answer is used, and it can be a cached one, so a record you changed minutes ago may still show the old target. DNS Propagation compares four resolvers for the CNAME type.

Hostnames that exist only on a private network cannot be checked. Each visitor can run 15 lookups a minute, and IP Tracker keeps no history of them.

Frequently asked questions

When should I use a CNAME instead of an A record?

Use a CNAME when a service gives you a hostname to point at. The service can then change its addresses without involving you.

Use an A record when you have a fixed IP address, and for the top of the domain, where a CNAME is not allowed.

Why does my main domain return no CNAME record?

Because the top of a domain cannot normally have one. It must hold the NS and SOA records of the domain, and a name with a CNAME may hold nothing else.

Main domains use A and AAAA records, or a flattening feature of the DNS provider that produces them.

Is a CNAME the same as a redirect?

No. A redirect is an instruction from a web server that sends the browser to a different address, and the address bar changes. A CNAME works inside DNS and is invisible to the visitor. The browser keeps the name it started with.

To send visitors from one address to another, set up a redirect on the web server. HTTP Status shows whether an address redirects and where to.

Can a CNAME point to an IP address?

No. The target must be a hostname. To point a name at an IP address, create an A record for IPv4 or an AAAA record for IPv6.

How do I find the IP address behind a CNAME?

Enter the original hostname into Hostname to IP. The resolver follows the alias, and the tool lists the IPv4 and IPv6 addresses found at the end.

The CNAME is correct but the site shows an error. What is wrong?

DNS is doing its part, and the problem is at the target. Most often the service has not been told about your hostname, so it does not know which customer the request belongs to. Add the hostname in the custom domain settings of the service.

A certificate warning has the same cause: the service has not yet issued a certificate for your name. SSL Checker shows which names the certificate covers.

Does a CNAME make a site slower?

Slightly, and only on the first lookup. A resolver may need one more question to reach the address. After that the answer is cached for a while.

Long chains add more steps, which is one reason to keep them short.