0

Currently, I have an AWS S3 Bucket named www.example.com setup to host static files and a CNAME record with host www and target www.example.com.s3-website-some-region.amazonaws.com.

I would like to set up a DNS record to ultimately resolve the base domain example.com to subdomain www.example.com.

I have tried the following DNS record set ups while also having the aforementioned CNAME record ( I APOLOGIZE FOR THE UNDERSCORES, BUT STACK WAS CALLING MY POST SPAM BECAUSE I HAD TOO MANY URLS/DOMAINS. PLEASE REPLACE THE UNDERSCORES BELOW WITH PERIODS ):

  1. ALIAS Record with Host @ and target www_example_com which resulted in HTTP ERROR 404.
  2. URL Redirect Record with Host @ and destination url http://www_example_com/ which resulted in DNS_PROBE_FINISHED_NXDOMAIN.
  3. CNAME Record HOST @ with target www_example_com which resulted in name resolution, but a response from AWS that there is no such bucket ( which makes sense ).

The question from the title "Is there a way to configure DNS records to ultimately resolve a domain (example.com) to a subdomain (www.example.com)?" has a stipulation that the HOST HTTP HEADER is www.example.com ( which is what i believe to be the reason why the CNAME record test from above didn't work ).

Why does the ALIAS record result in an HTTP ERROR 404.

Why does the URL Redirect record result in DNS_PROBE_FINISHED_NXDOMAIN error. I setup a URL Redirect record for other subdomains to redirect to the www sub domain. However, the URL Redirect from the base domain does not seem to work. The browser does not redirect example.com to http://www.example.com.

Is there a reason why I can't have a URL redirect record from a base domain to a url?

I understand that I can setup a redirect directly on AWS ( which is more than likely what I'll be doing )

example domain records

MrDrago9
  • 1
  • 2
  • "Is there a way to configure DNS records to ultimately resolve a domain (example.com) to a subdomain (www.example.com)?" Soon yes, or already at certain providers but not all clients will use them: look at new DNS HTTPS/SVCB records. They exist exactly to offer the "CNAME at apex" feature (but other things too). As for the rest, if you want specific help you need to give the real names. Or do yourself an online test using the very good DNSViz utility. – Patrick Mevzek Jul 23 '22 at 00:02
  • Awesome! Do you have a link to a site where I can read more about this? – MrDrago9 Jul 28 '22 at 18:14
  • Start maybe with https://www.domaintools.com/resources/blog/the-use-cases-and-benefits-of-svcb-and-https-dns-record-types or https://blog.cloudflare.com/speeding-up-https-and-http-3-negotiation-with-dns/ ; Support is slowly being added to Chrome, Firefox, Safari... – Patrick Mevzek Jul 28 '22 at 18:19

1 Answers1

1

sorry for my english, I'm french ;) You can't create a CNAME record for the top node of a DNS namespace like "example.com", but only for subdomains like www.example.com, myserver.example.com, etc.

Note also if you create a CNAME record for a subdomain, you cannot create any other records for that subdomain anymore. Example: if you create a CNAME for myserver.example.com, you cannot create any other records for which the value of the Name field is myserver.example.com.

Hope that will helps you.