AWS S3 and Route 53: www redirect does not work

amazon s3amazon-route53amazon-web-servicesaws-directory-servicedomain-name-system

I have hosted my static website on AWS S3, like in,

http://example.net

I have configured two S3 buckets, one for http://example.net, and another
one for http://www.example.net, whose 'Static web hosting' has been setup
to redirect to http://example.net.

Since my domain name was bought with some other provider, I have added Hosted
Zones on Route 53 for both the entries. I have also configured record sets
for both the entries. The record sets of http://www.example.net have the
same contents as http://example.net

While http://example.net is working (I am able to browse as well as ping
this domain, I am not able to ping as well as browse to http://www.example.net.
Ping fails with the following error:

"Ping request could not find host www.example.net. Please check the name and try again."

Any help or information to resolve this issue would be much appreciated.

Note: All references to 'example.net' is just an example, and the real name
of my domain name is different.

Best Answer

Your DNS for the real domain that you shared with me seems incompletely configured.

This is the "example.net" record:

$ dig a example.net
example.net.        5   IN  A   52.219.xx.xx

While this is the "www.example.net" record:

$ dig a www.example.net
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 21945
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; QUESTION SECTION:
;www.example.net.           IN  A

Apparently the record for www doesn't exist. Re-check your Route53 settings.

Hope that helps :)

Related Topic