Trying to setup cloudflare DNS entry for a S3 bucket

I have my static html files stored in a S3 bucket where the bucket name matches my domain name. Static website Hosting is “enabled” and Hosting Type is set to “Redirect Request” plus Protocol is set to “None”. Host Name is set to my domain name.

Cloudflare(CF) is the registrar for the domain.

In CF, under DNS settings, while trying to add a CNAME record…

  1. Entered my domain name in NAME box
  2. Entered the endpoint url from Amazon S3 bucket in TARGET box

I get the error: DNS Validation error (Code: 1004) Content for CNAME record is invalid

Have been stuck on this for over a week. scanned WEB for similar topics–not worked. I would appreciate help in resolving this

Thank you,
Rich F

Please click the 1004 link in your post for instructions.

Thank you as I have already read that prior and could not identify anything I have done wrong.

For the Cloudflare CNAME TARGET box I am using this endpoint from s3 bucket

is the same name I used in Cloudflare for website name and host name that Cloudflare is the registrar for.

The error message you are receiving suggests that the content you have entered for the CNAME record is invalid. Here are some things to check to help you resolve this issue:

  1. Make sure that the endpoint URL you are entering in the TARGET box is correct and valid. You should be able to access your static files using this URL.
  2. Check that you are entering the correct syntax for the CNAME record. The format should be: CNAME NAME TARGET. Make sure there are no typos or errors in the record.
  3. Verify that the DNS validation error is not related to a DNS propagation issue. Sometimes it can take up to 24 hours for DNS changes to propagate across all servers. Wait a few hours and try again to see if the error persists.
  4. Ensure that the target URL you are using does not include an IP address, as some DNS providers may reject a CNAME record that points to an IP address. If this is the case, you may need to use an A record instead.

Hi @richnpeg

Have a look at our developer documentation, where we explain how adding vendor-specific DNS records to Cloudflare, specifically for Amazon:

Hope it helps you.

Take care!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.