0

Let's say I have a website with a domain name, of course. The domain name has:

  • One A record(example.com) which points to the origin server(or load balancer).
  • One CNAME record(cdn.example.com) which points to a CDN server.

Now, my question is, when a client makes a request to cdn.example.com then how is this request directed to the nearby CDN edge server? Who resolves this? Is it the DNS server maintained by the ISPs, the CDN itself, or something else?

Ram Patra
  • 111
  • 4

2 Answers2

1

To answer your question. cdn.example.com will point to something like example-customer.cdn-provider.com. This is a DNS zone under the control of the CDN provider. From this point you can take a look at CDN: How is it possible that my DNS delivers a different IP depending on the visitors location?

Depending on what you want to do, the setup should be different. Most likely you want to utilise the CDN for all requests to example.com.

Since a CNAME is not possible on the Apex of the domain a requirement for CDNs is often to have the domain hosted with your CDN provider. This way they can answer queries for A and AAAA dynamically as explained in the above mentioned answer.

Jonathan
  • 575
  • 1
  • 7
  • 17
0

In your example, example.com points to the origin server.

The CNAME record cdn.example.com points to your.cdn.com.

When a client makes a request to cdn.example.com your DNS server returns your.cdn.com.

The CDN's name servers will resolve the your.cdn.com. The DNS server is maintained by the CDN.

The IP address of the nearest edge server is determined by the CDN's DNS server. See this answer for more information as to how this is done. CDN: How is it possible that my DNS delivers a different IP depending on the visitors location?

Mike Marseglia
  • 883
  • 7
  • 18