Question

@ is invalid hostname DO DNS Cname record.

Posted April 2, 2021 335 views
DNSCDN

I’m trying to direct my main site URL to a CDN where the files are stored. My backend is in a droplet so I’m using DO DNS. The problem is it doesn’t allow me to use @ as a hostname in the cname record to redirect my domain to the cdn, keeping my subdomain on DO.

Any ideas?

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.

×
Submit an Answer
1 answer

Hello, @camilamarencofotografia

A CNAME record defines an alias for an A record; it points one domain to another domain instead of to an IP address. When the associated A record’s IP address changes, the CNAME will follow to the new address.

On DigitalOcean, CNAME records have the following fields.

  • HOSTNAME, which should be set to the subdomain prefix for the new alias you want to create.
  • IS AN ALIAS OF, which should be set to the hostname where the alias should point. For the alias to work, the hostname must have an A record or be handled by a wildcard A record. This can be:
  • The apex domain (@). To map a apex domain, like example.com, enter the @ symbol.
  • A subdomain (e.g. site.example.com).

You can check our docs for managing DNS records. For CNAME follow the link below:

https://docs.digitalocean.com/products/networking/dns/how-to/manage-records/#cname-records

Hope that this helps!
Regards,
Alex

  • Yeah but what if I need the hostname to be the site’s domain and not a subdomain, to point it to a external url?

    Doesn’t seem to be possible

    Can I use a third party dns and still have my sub-domain connected to my droplet?