Report this

What is the reason for this report?

having www.domain.com serve up content from digitalocean spaces cdn

Posted on May 7, 2022

Say I have domain.com and I would like it to serve up static content hosted on a DigitalOcean Space.

I updated my DNS registrar (GoDaddy) to have ns1.digitalocean.com and ns2.digitalocean.com as the nameservers per https://docs.digitalocean.com/tutorials/dns-registrars/

In Networking - Domains, on digitalocean.com, I added domain.com and www.domain.com. On creation each domain had 3 NS entries:

enter image description here

I then created a DigitalOcean Space, uploaded my files and added www.domain.com as a custom subdomain:

enter image description here

Doing so added a CNAME record to the domain.com:

enter image description here

The problem is that when I visit www.domain.com or domain.com in my browser I get a “This site can’t be reached” error. Doing nslookup www.domain.com yields the following:

Server:  UnKnown
Address:  192.168.1.1

Name:    www.domain.com

What do I need to do to make it so that www.domain.com is serving up content from the CDN?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

As you are getting a UnKnown response from the nslookip, keep in mind that it might take up to 24 hours for the DNS cache to clear up once you’ve made a DNS change.

Regarding the main domain not responding, once you’ve changed your nameservers, did you add an A record for domain.com to point to your server IP address?

As a side note, regarding the CDN, usually, I would go for cdn.domain.com or static.domain.com rather than www as the www version is, in most cases, an alias for the main domain name rather than a CDN.

https://docs.digitalocean.com/products/spaces/how-to/enable-cdn/

Best,

Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.