Suggest an editImprove this articleRefine the answer for “What is CNAME?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**CNAME (Canonical Name)** is a **DNS record** that makes **one domain name an alias for another domain name**. **Key point:** a CNAME does not contain an IP address itself and cannot be used for the domain root - DNS then looks up records for the name the CNAME points to.Shown above the full answer for quick recall.Answer (EN)Image**CNAME (Canonical Name)** is a **DNS record** that makes **one domain name an alias for another domain name**. In simpler terms: **CNAME says: "this name is just another name for another domain"**. --- ## Why CNAME is needed CNAME is used to: - point several names at the same resource - avoid duplicating IP addresses in DNS - simplify managing domains and subdomains For example: ``` www.example.com -> example.com ``` `www.example.com` is not a separate site, just **another name** for `example.com`. --- ## How CNAME works 1. The client requests: ``` www.example.com ``` 2. DNS sees the CNAME: ``` www.example.com -> example.com ``` 3. DNS **then looks up records for example.com** 4. It finds an A / AAAA record and returns the IP A CNAME **does not contain an IP address itself**. --- ## Example of a CNAME record Simplified: | Name | Type | Value | |---|---|---| | www.example.com | CNAME | example.com | | example.com | A | 93.184.216.34 | In total: `www.example.com` -> `example.com` -> `93.184.216.34` --- ## Important CNAME restrictions This is often asked in interviews: A CNAME **cannot be used for the domain root** (`example.com`) (in classic DNS) A name with a CNAME **must not have other DNS records** (A and CNAME cannot coexist) So: - `www.example.com` -> CNAME is fine - `example.com` -> usually A / AAAA --- ## When CNAME is especially useful - CDNs (Cloudflare, CloudFront, etc.) - external services (GitHub Pages, Heroku) - when the IP can change often - when one service needs to be reachable under different names --- ## Real-life example CNAME is like: - a person's alias - there is one real name, but you can address them differently --- ## Short interview answer Remember this formulation: > **CNAME is a DNS record that indicates one domain name is an alias for another domain name, and it redirects DNS resolution to it.**For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.