Domain insights

CDN for domain owners: how DNS connects visitors to nearby copies of your site

Understand origin servers, edge caches, DNS records, HTTPS and safe deployment practices before placing a CDN in front of your domain.

Web performance and DNS
CDN for domain owners: how DNS connects visitors to nearby copies of your site

Imagine your website lives in one warehouse on the far side of the map. Every visitor, wherever they are, must walk there, collect a copy of the page and return home. That may feel acceptable on a quiet day, but during a launch the single warehouse door becomes a bottleneck and some visitors leave before the page arrives.

A content delivery network, or CDN, stocks local stores with reusable copies of popular pages and files. Visitors can receive those copies from a nearby network location, while the original warehouse remains the source of truth for new content and anything that cannot safely be reused.

What a CDN actually is, and what it is not

A CDN is a network of edge locations, sometimes called points of presence, that sits between the public internet and your origin. Your domain still identifies the site, DNS still tells browsers where to begin, and your hosting platform still runs or stores the authoritative website. The CDN becomes the front door that most web requests meet.

  • It does not replace ownership of the domain or the need for authoritative DNS. It does not replace ownership of the domain or the need for authoritative DNS.
  • It does not automatically rewrite a slow application into a fast one. It does not automatically rewrite a slow application into a fast one.
  • It does not remove the need for reliable hosting, backups, updates and access controls. It does not remove the need for reliable hosting, backups, updates and access controls.
  • It is not the same as moving a site to the cloud, even when a cloud provider sells the CDN. It is not the same as moving a site to the cloud, even when a cloud provider sells the CDN.

Origin versus edge: warehouse and local store

The origin is the source server: shared hosting, a VPS, a dedicated server or an application platform. When an editor updates an article, uploads a product image or deploys code, the change lands there first. The edge is a CDN server selected by network routing to serve a visitor; “nearby” means close in network terms and not necessarily the closest point on a physical map.

When a browser requests a file, the edge first checks whether it has a fresh, reusable response. If it does, the cache hit avoids another trip to the origin. On a cache miss, the edge asks the origin, returns the response and may store it according to the response headers and CDN policy. Misses are normal; the goal is to avoid repeating origin work for content that changes rarely.

Colorful diagram showing a domain resolving through DNS to a CDN edge, with cache hits, cache misses and email bypassing the CDN
A CDN changes the web request path; it should not silently replace the DNS records used by email.

What a CDN caches, and what it usually should not

“The CDN caches the site” is too imprecise to be useful. Caching is a policy: each response needs a decision about whether it may be stored, how long it remains fresh, what makes one variant different from another and how it will be invalidated after a release.

ContentTypical approachReason
Versioned images, CSS and JavaScriptCache for longer periodsThe filename changes when the file changes
Public articles and product pagesCache with a deliberate freshness policyMany visitors receive the same response
Cart, account and personalized pagesBypass or use narrowly tested rulesResponses can contain private or user-specific data
API responsesDecide endpoint by endpointMethod, authorization and response headers affect reuse

A dynamic site can still benefit. The CDN may proxy account and search requests to the origin while storing the images, scripts, styles and public pages those experiences use. In the bookstore metaphor, posters and shelf labels stay locally available even when the cashier must call the warehouse for a customer-specific order.

Authenticated dashboards, carts, checkout, forms, administration panels and personalized API responses deserve conservative defaults. Cookies, Authorization headers, Cache-Control directives and Vary behavior must be understood before a shared edge is allowed to reuse a response for another visitor.

How DNS points web traffic to the CDN

A domain does not discover a CDN automatically. DNS answers for the public web hostnames must lead browsers to the CDN network instead of directly to the origin. The exact record depends on the hostname and on what the CDN documents for its service.

CNAME for a subdomain

For www.example.com, a common setup is a CNAME to a hostname supplied by the CDN. The CDN can then resolve that service name to suitable edge addresses without requiring the domain owner to maintain its changing IP inventory.

Apex records and provider-specific flattening

The zone apex, example.com without www, must contain SOA and NS data, so a conventional CNAME cannot occupy that same owner name. DNS providers may offer ALIAS, ANAME or CNAME flattening, which behave like aliases in their control panel but return A or AAAA answers on the wire. Another valid design redirects the apex to www, or uses stable A and AAAA addresses published by the CDN.

Mail and verification records stay separate

MX records should continue to point to the mail provider, and mail hostnames are normally not proxied through a website CDN. Preserve SPF, DKIM, DMARC and ownership-verification TXT records unless the responsible service gives you a documented replacement. “Pointing the domain to the CDN” should mean changing the intended web hostnames, not rewriting the whole zone.

HTTPS and certificates at the edge

With a CDN in front, the browser normally performs its TLS handshake with the edge. The edge therefore needs a valid certificate covering every public hostname visitors type. Providers may issue and renew certificates after domain-control validation or allow a customer-managed certificate.

There is usually a second connection from edge to origin. Protect that path with authenticated HTTPS as well; an “encryption only” mode that ignores the origin certificate can hide a configuration error rather than solve it. Confirm the public name exists on the edge certificate, the origin presents an expected certificate and no page loads insecure assets over HTTP.

If HTTPS fails immediately after the DNS cutover, check whether certificate validation completed, whether every hostname was added to the CDN and whether the origin expects the correct Host header. A CDN cannot erase mixed content or make a certificate for one name valid for another. Compare SSL certificates

Cache hits, misses and releases that appear haunted

After a release, an edge may still hold yesterday’s CSS or hero image until its freshness lifetime ends or a purge invalidates it. One city can see the new edition while another receives the old one because their edges cached at different times. That is stale cache, not a random global update process.

  • Use versioned or content-hashed filenames so a new release requests new objects instead of colliding with old ones. Use versioned or content-hashed filenames so a new release requests new objects instead of colliding with old ones.
  • Know which HTML and asset paths have long freshness values before launch day. Know which HTML and asset paths have long freshness values before launch day.
  • Purge the changed paths after important releases and remember that one URL may not invalidate every related variant. Purge the changed paths after important releases and remember that one URL may not invalidate every related variant.
  • Monitor cache status and origin traffic so a miss storm does not surprise a small server. Monitor cache status and origin traffic so a miss storm does not surprise a small server.

When a CDN helps

The bookstore model works well when a large share of transferred bytes consists of images, scripts, styles, downloads and public pages requested repeatedly. It can reduce distance for geographically distributed visitors and shield the origin from resending identical content all day.

A large edge network can also absorb bursts and filter some unwanted traffic before it reaches one origin. Treat this as additional resilience, not immunity: application security, updates, monitoring, backups and an incident plan remain necessary. Compression, redirects, modern HTTP support and firewall controls are optional product capabilities, not the definition of a CDN.

What a CDN cannot repair

Local stores cannot fix a warehouse that sends broken books. A cache hit may make the home page feel fast while an uncached checkout still waits on a slow database, blocked plugin or undersized server. Every cache miss and dynamic request exposes the real origin performance.

  • It cannot make an inefficient database query fast. It cannot make an inefficient database query fast.
  • It cannot replace backups, software updates or access control. It cannot replace backups, software updates or access control.
  • It cannot keep a tiny origin alive if every miss overwhelms it. It cannot keep a tiny origin alive if every miss overwhelms it.
  • It cannot transform personalized responses into public content without application design. It cannot transform personalized responses into public content without application design.

A local business with nearby visitors and light traffic may be better served first by dependable hosting, optimized images and correctly configured HTTPS. A CDN is a tool selected for a workload, not a badge every site must install. Review SoxDomains hosting

Common setup mistakes and how they feel

Wrong origin

The CDN points to an old server, staging environment or default welcome page and efficiently caches the wrong site. Verify the origin hostname, address, Host header and direct response before sending public DNS to the CDN.

Stale cache after a deploy

New code is live at the origin but visitors receive older JavaScript or CSS. Use versioned assets, understand freshness values and include selective invalidation in the release process instead of learning the purge controls during an incident.

Only some hostnames moved

The www record reaches the CDN while the apex or a static hostname still reaches the former server. Inventory every public web name and decide intentionally whether the apex redirects to www or the reverse. Lower relevant TTLs ahead of the planned cutover.

Certificate mismatch

DNS has moved, but the edge certificate does not contain the hostname visitors use. Add and validate all hostnames before the cutover, and test both the apex and www instead of assuming one certificate state covers the other.

Personal content was cached

An overly broad rule can preserve an empty cart for everyone or, worse, expose one user’s fragment to another. Cache only content known to be public, bypass authenticated paths and test cookies, authorization and locale variants explicitly.

Mail records were disturbed

A zone-wide edit accidentally changes MX or deletes verification TXT records while moving the website. Restore from the zone export and separate the web cutover from mail changes unless both are part of a tested plan.

Testing happened from one city and one browser

Your nearby edge is fresh while another region still has an older object. Check provider cache status, test more than one network or region and distinguish browser cache from CDN cache before declaring the release complete.

How the pieces fit for a domain owner

You own the domain; its authoritative DNS publishes the map; the application runs at an origin; the CDN property identifies the public hostnames and origin; certificates protect edge and origin connections; cache rules decide what may stay locally; finally the web records lead visitors to the CDN. The domain remains yours and the CDN becomes the front door most visitors use.

Practical checklist: putting a site behind a CDN

Before and after the cutover, use the free SoxDomains DNS Lookup to inspect the public A, AAAA, CNAME, MX, NS and TXT answers for each hostname. It gives you an independent public view without changing the zone, which makes it useful for confirming that web records moved while mail records stayed intact. Open SoxDomains DNS Lookup

Before touching public DNS

  • List every hostname that serves public web traffic. List every hostname that serves public web traffic.
  • Confirm the origin works directly and retain a controlled way to reach it after DNS changes. Confirm the origin works directly and retain a controlled way to reach it after DNS changes.
  • Classify public cacheable paths and private paths that must reach the origin. Classify public cacheable paths and private paths that must reach the origin.
  • Lower relevant DNS TTLs early enough for the previous higher values to expire. Lower relevant DNS TTLs early enough for the previous higher values to expire.
  • Export the zone and mark mail and verification records that must remain untouched. Export the zone and mark mail and verification records that must remain untouched.

Inside the CDN configuration

  • Set the correct origin hostname or address and required Host header. Set the correct origin hostname or address and required Host header.
  • Add every public hostname and wait until edge certificates are valid. Add every public hostname and wait until edge certificates are valid.
  • Use authenticated HTTPS between the edge and origin. Use authenticated HTTPS between the edge and origin.
  • Define static cache rules and explicit bypasses for private or dynamic routes. Define static cache rules and explicit bypasses for private or dynamic routes.
  • Document selective purge and decide the canonical apex/www direction. Document selective purge and decide the canonical apex/www direction.

During DNS cutover

  • Update only documented web records such as CNAME, ALIAS, A or AAAA. Update only documented web records such as CNAME, ALIAS, A or AAAA.
  • Leave MX and unrelated TXT records unchanged. Leave MX and unrelated TXT records unchanged.
  • Verify every hostname, certificate and redirect after resolution changes. Verify every hostname, certificate and redirect after resolution changes.
  • Test public pages, login, forms and checkout in a private browser session. Test public pages, login, forms and checkout in a private browser session.

After go-live

  • Deploy a harmless visible change and prove that versioning or purge delivers it. Deploy a harmless visible change and prove that versioning or purge delivers it.
  • Watch origin logs and analytics for unexpected misses or failures. Watch origin logs and analytics for unexpected misses or failures.
  • Record where DNS, CDN and origin are managed, who can purge and how to roll back. Record where DNS, CDN and origin are managed, who can purge and how to roll back.

If a step fails, reverse it deliberately. Keeping the former DNS target and a functioning origin available during the validation window is ordinary operational discipline, not pessimism.

Your domain, your map, many doors

You do not need the most elaborate CDN. You need clear DNS ownership, a stable origin, honest cache rules, certificates matching every hostname and a repeatable release habit. When a dashboard becomes confusing, ask whether the setting controls the warehouse, the books allowed on local shelves, how long they remain there or the street signs that guide visitors.

A CDN adds nearby doors; it does not replace the domain, DNS or hosting. Point the correct hostnames, protect both connections, cache what is safe, bypass what is personal and keep the origin worth copying. Walk the checklist before changing records so the next late-night stale logo is a controlled fix rather than a mystery. Explore international domains

Frequently asked questions

Does a CDN replace web hosting?

No. The origin hosting still runs or stores the authoritative site, while the CDN distributes eligible responses and forwards misses. Origin capacity and application quality continue to matter.

Will changing web DNS affect email?

It should not if you change only the intended web records and preserve MX and mail-related TXT records. Export the zone first and verify mail immediately after the cutover.

Can I use a CNAME at the root of my domain?

A conventional apex CNAME conflicts with the SOA and NS records required at that name. Some DNS providers offer ALIAS, ANAME or CNAME flattening as provider-specific alternatives.

Should a CDN cache account and checkout pages?

Usually not in a shared cache unless the application and response directives are deliberately designed for it. Bypass private and personalized routes, then test authenticated behavior before launch.

Do I need an SSL certificate with a CDN?

Yes, HTTPS requires a valid certificate at the edge for the public hostname. Use authenticated HTTPS from the CDN to the origin as well so both connections are protected.

How do I prevent visitors from seeing old files after a release?

Use versioned asset filenames and suitable Cache-Control values. Purge changed HTML or paths when necessary instead of depending on repeated global purges.

Will a CDN always make a website faster?

No. Results depend on visitor location, cacheability, origin performance and configuration. Measure representative pages and regions before and after deployment.

What should I keep for rollback?

Keep the previous web records, TTLs, origin details and a tested path to disable proxying. Do not retire the old route until DNS, HTTPS, email and application behavior are stable.