Reputation: 1059
I purchased a domain on uniregistry (ka.beer) and I want to set it up to use S3 for hosting and using route 53 for the DNS.
Steps I have taken so far:
Create hosted zone on route 53 with the name of the root domain (ka.beer)
Taken the NS records generated from this zone and updated the NS records of the domain on uniregistry, verified that this is propagated correctly using whatismydns.net
Created 2 buckets with names ka.beer and www.ka.beer in S3
Set up the root bucket to be public using the bucket policy and uploaded a test index page
Set up both buckets for static web hosting, with the www bucket to redirect to the main domain
Created A records in route 53 for ka.beer and www.ka.beer as aliases with the alias target to be the S3 zone (s3-website.eu-west-2.amazonaws.com.)
Now what I want is when I visit www.ka.beer, for it to redirect to ka.beer and when I visit ka.beer for it to show the website uploaded to that S3 bucket and to keep the same domain name
What happens currently: www.ka.beer does not resolve and ka.beer redirects to ka.beer.s3-website.eu-west-2.amazonaws.com
Thanks
Upvotes: 0
Views: 2435
Reputation: 1059
Very frustrating issue but it turns out that the nameserver records were cached on my router. Clearing local cache and using incognito did not solve the problem, I had to log in to my router and reset the cache on there and then it started resolving correctly.
Upvotes: 2
Reputation: 912
have a look on below steps.
Note: Domain setting : You can visit here under your domain provider
After updating nameserver in your domain provider. It can take time for updation.
After that create A record under hosted zone under Route53 and assign the bucket or EC2 instance.
After some time your domain with point to that instance
Upvotes: 0
Reputation: 106
It looks you were doing the AWS Example: https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html
If that's the case, check your Route53 entries. The domain name should match the S3 bucket name.
ka.beer A http://ka.beer.s3-website-us-west-2.amazonaws.com
www.ka.beer A http://www.ka.beer.s3-website-us-west-2.amazonaws.com
Upvotes: 0