US Trends

what is cname in dns

A CNAME in DNS is a special record that makes one hostname an alias of another hostname, instead of pointing directly to an IP address.

Quick Scoop: What is a CNAME in DNS?

  • CNAME stands for “Canonical Name” record.
  • It tells DNS: “this name is just another label for that other domain name.”
  • Unlike an A record, a CNAME never points to an IP address, only to another domain/hostname.

Example:
blog.example.com CNAME example.com
When someone visits blog.example.com, DNS first resolves example.com and returns its IP via the A/AAAA record.

How a CNAME Works (In Plain English)

  1. User types blog.example.com in the browser.
  1. DNS looks up blog.example.com and finds a CNAME pointing to example.com.
  1. DNS then does a second lookup for example.com to get its A/AAAA record and IP.
  1. The browser connects to that IP, but the request still contains blog.example.com as the Host header, so the server can serve blog content if configured that way.

Think of a CNAME like a “See also” card in a library catalog that sends you to the main card that has the real shelf location.

Why Use a CNAME Record?

Common use cases:

  • Managing many subdomains that all go to the same service (e.g., www, blog, shop).
  • Pointing branded subdomains to third‑party services (e.g., help.example.com → your helpdesk provider).
  • Domain ownership verification (e.g., Google or other SaaS tools giving you a special CNAME target).
  • Keeping DNS easier to maintain: change the IP in one place (the canonical domain’s A record) and all CNAME aliases automatically follow.

Key Rules and Restrictions

These are important “gotchas” with CNAMEs:

  • A CNAME must point to a domain name, not an IP address.
  • A name that has a CNAME cannot have other record types at the same label (no MX, TXT, A, etc., on the same exact name).
  • Long CNAME “chains” (A → B → C → …) are technically allowed but discouraged because every extra hop adds lookup time.
  • Many providers do not allow CNAME at the root (apex) of the domain (e.g., example.com), only on subdomains like www.example.com.

Simple HTML-Style Table of CNAME Facts

[3][5][1] [9][5][1] [3][9][1] [2][7][5][3] [5][8][1] [8][1][5]
Aspect Details
Full name Canonical Name (CNAME) DNS record
Points to Another domain/hostname, not an IP address
Main purpose Create an alias so multiple names resolve to the same underlying host
Typical use Subdomains (e.g., www, blog, shop) and third‑party SaaS integrations
Can it coexist with other records on the same name? No, you cannot have A, MX, TXT, etc. on a name that has a CNAME
Performance note Each CNAME adds at least one extra DNS lookup; long chains hurt performance

Mini “Story-Style” Example

Imagine you host your main site at example.com and your infrastructure team sometimes changes its IP.

  • You set www.example.com and blog.example.com as CNAMEs to example.com.
  • Later, your hosting provider gives you a new IP for example.com; you only update the A record for example.com.
  • Instantly, www.example.com and blog.example.com both follow that change automatically, with no extra edits.

This is the practical power of CNAME: fewer moving parts to manage, less chance of missing an update. TL;DR: A CNAME record in DNS is an alias that maps one hostname to another hostname (never directly to an IP), mainly used to simplify DNS management and keep multiple domains or subdomains pointing to the same underlying service.

Information gathered from public forums or data available on the internet and portrayed here.