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…
Entered my domain name in NAME box
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
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:
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.
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.
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.
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.