Skip to main content
miji.be

CNAME Record

A CNAME record maps one domain name to another in DNS. Used to point custom branded short URL domains to the URL shortening service infrastructure without changing IP addresses directly.

May 1, 2026 / About 1 min read

Redirect

A CNAME (Canonical Name) record is a type of DNS record that maps an alias domain name to a canonical (true) domain name. When a DNS resolver encounters a CNAME record, it follows the alias to the canonical name and resolves that instead. This mechanism is fundamental to how custom domains work with URL shortening services and CDNs.

For URL shortening, CNAME records enable branded short URLs. A company creates a CNAME record pointing their custom domain (e.g., "go.company.com") to the shortening service's domain (e.g., "custom.shortener.com"). When a user visits "go.company.com/abc," the DNS resolution follows the CNAME to the shortening service, which then handles the redirect.

CNAME records have an important limitation: they cannot coexist with other record types at the same name. This means a CNAME cannot be set at the zone apex (e.g., "company.com" without a subdomain). To work around this, some DNS providers offer ALIAS or ANAME records that provide CNAME-like functionality at the zone apex.

When configuring CNAME records for URL shortening, it is important to also set up SSL certificates for the custom domain to enable HTTPS. Many shortening services handle certificate provisioning automatically, but some require manual configuration.

Was this article helpful?

Related Terms

Custom Domain

A privately owned domain name used with a URL shortening service instead of the service's default domain.

URL Rewrite

A server-side technique that internally maps a requested URL to a different resource without changing the URL displayed in the browser.

DNS Resolution

The process of translating a human-readable domain name into the IP address of the server hosting the website.

TTL

Time to Live - a value that specifies how long data should be cached or considered valid before being refreshed.

A Record

A DNS record that maps a domain name to an IPv4 address. The foundational building block of web hosting.

Typosquatting

An attack technique that registers look-alike domains targeting typos of well-known domains and exploits them for phishing or advertising revenue. The domains of URL shorteners are also targeted.

Related Articles

How Custom Short URLs Boost Brand Recognition

Discover how branded short URLs strengthen brand identity. Learn strategies for creating memorable custom URLs that increase trust and CTR.

Self-Hosting a URL Shortener: Full Link Control

Explore the benefits and challenges of running your own URL shortening service. Covers open-source tools, serverless architecture, and cost-performance tips.

How URL Shorteners Work - The Technical Side of Redirects

Discover the technical mechanics behind URL shortening: hash generation, database lookups, HTTP redirects, and more. Includes HTTP response examples and base-62 encoding calculations.

FAQ

What's the difference between a CNAME record and an A record?
An A record maps a domain directly to an IP address, while a CNAME record maps a domain to another domain name. With CNAME, no configuration change is needed when the IP address changes.
Can you set a CNAME record on a root domain?
Per DNS specifications, CNAME cannot be set on a root domain (example.com). Use ALIAS or ANAME records instead, or set the CNAME on a subdomain (www.example.com).

Put the terms to work

Shorten a URL for Free