← Back to blog
Basics2 min read

CNAME record explained simply: what it does and when you need it

Image from Unsplash

DNS is the phone book of the internet. It translates names such as yourcompany.com into addresses that computers can use. A CNAME record is a special entry in that phone book: instead of an address, it contains another name.

What a CNAME actually says

A CNAME for qr.yourcompany.com with the target service.example.com means: anyone looking for qr.yourcompany.com should check where service.example.com lives and go there. If the service changes its servers, you do not have to touch anything, because your record points to the name, not the address.

CNAME or A record?

  • An A record points to a fixed IP address, such as 203.0.113.10. It fits when you know the address and it does not change.
  • A CNAME points to a name. It fits when a service runs the technology behind it and decides which servers answer.
  • For the same subdomain there is either a CNAME or other records, not both.

Why not on the main domain?

The main domain yourcompany.com usually already has records for your website and email. Next to a CNAME, however, no other records may exist for the same name. That is why services such as shops, newsletters or QR codes use a subdomain like shop., news. or qr.

How to create a CNAME

  • Open DNS management at your domain provider.
  • Create a new record of type CNAME.
  • Name: only the part in front of your domain, such as qr. Some interfaces want the full name, most do not.
  • Target: the name the service gives you, without https:// in front.
  • Save and wait a few minutes.

Common mistakes

  • Target with https:// or a path: a CNAME only knows names, not web addresses.
  • Doubled domain: qr.yourcompany.com.yourcompany.com appears when the interface adds the name itself.
  • Old A record left in place: then it is unclear which one applies, and usually the wrong one does.

For QR codes on your own subdomain, the CNAME is the step that actually makes the scans arrive at the service. At Same-QR the target is kunden.sameqr.com.

Create dynamic QR codes for free
Start with 20 dynamic QR codes that are free forever. No subscription, no credit card.
Start free now →

Frequently asked questions

Can I remove a CNAME again?

Yes. The subdomain then no longer points to the service, and everything that ran through it stops working. So be careful with printed QR codes.

How is it different from a redirect?

A redirect sends the browser to a different web address. A CNAME only changes which server answers under your name. The address in the browser stays yours.

Newsletter

New articles straight to your inbox

Tips on dynamic QR codes, new features, no spam. Unsubscribe any time.

By subscribing you consent to receiving the newsletter. You can withdraw consent at any time via the unsubscribe link in every email.

Keep reading