Static website on S3 with route 53 - Site can't be reached - amazon-web-services

I have hosted a static website on S3 with suitable bucket policy set. Viewing the "endpoint" in another tab works perfectly fine. After this I created a Hosted zone in route 53 to give it a desirable human readable address.
After creating the hosted zone, I have two records in my newly created hosted zone, One being of type NS and the other being of type SOA. So far so good. I go ahead to create a new record set.
I add the name as desired, enter type as 'A' - IPv4 Address tick yes for Alias, where in the drop down (Alias Target) i can see my previously created bucket endpoint.
I set the routing policy to be simple and Evaluate Health Target set to no. The record set is created successfully. However when i enter this name in another tab, I get the "Site can't be reached". I try and test the record set using the functionality provided by AWS. Here the response code i get is "NOERROR" which i assume is a positive response. Am I missing something here.
I have also referred to this video. Am I missing something. Also, I have not created the Hosted Zones myself.

A hosted zone is not the same as domain. You have to update the NS values for your domain registrar to point to the NS values as generated by Route53.
From the docs:
When you create a hosted zone, Amazon Route 53 automatically creates a
name server (NS) record and a start of authority (SOA) record for
the zone. The NS record identifies the four name servers that you give
to your registrar or your DNS service so that DNS queries are routed
to Amazon Route 53 name servers.
[...]
After you update the settings with your domain registrar to include
the Amazon Route 53 name servers, Amazon Route 53 responds to DNS
queries for the hosted zone even if you don't have a functioning
website.
NS transfer may take from 1 to 24 hours, depending on the registrar.

I faced the same issue. I bought domain thevegfoodies.com through AWS Route 53, created simple index.html page and uploaded to bucket thevegfoodies.com and set bucket for Static website hosting ,added public policy. created second bucket www.thevegfoodies.com and redirect to thevegfoodies.com, created aliases everything , read through documents everything. But nothing worked.
Until, i realized that my redirect bucket www.thevegfoodies.com was not set for public read access. I set it too Read bucket permissions for Everyone. (Note my primary bucket thevegfoodies.com already has public access.) and i could load my website using my domain name.
Now, I have read through AWS document again just to see if I missed this step of setting up public access for redirection bucket.
https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html and all other steps to setup static website.
if you check Step 2.3: Configure Your Website Redirect, it is not mention that we need to set public access.
POINT- AWS Documentation is not clear. One need to have public access to redirect bucket too.

Related

IP Address not found on route 53 domain

I'm starting out on AWS and try to host a website on the platform. The S3 bucket and its content is set up and i'm able to access the website via the url s3 is providing.
Permissions and properties are set to accept public traffic and that the bucket is used to host a website. The index document is correct.
Now i want traffic to be redirected to my domain visionranger.com, but it shows the error "IP address could not be found"
I tested this issue on 4 different devices across multiple browsers (including Chrome, Safari and Firefox).
Bucket, domain and hosted zone do have the same name and as AWS recommends, I asked my previous provider if they transferred the dns services to the new provides (in this case route 53) and they did.
I waited longer than 48 hours after settings everything up before writing this so all services should be working by now - but they don't.
The image shows the dns records of route 53.
I am grateful for any help.
By running a DIG command to get the NS value of your domain it returns a SERVFAIL indicating that the configured nameservers for your domain do not contain the record for you domain.
The next step is to run a whois which indicates your configured nameservers are below:
NS1.BDM.MICROSOFTONLINE.COM
NS2.BDM.MICROSOFTONLINE.COM
NS3.BDM.MICROSOFTONLINE.COM
NS4.BDM.MICROSOFTONLINE.COM
As you're trying to use a Route 53 public hosted zone you will need to update your domain registrar to use the nameservers found under the NS record of the public hosted zone.
Follow the instructions here for your specific domain.

Routing domain hosted in third-party to AWS S3

I am trying to direct a URL request to an AWS S3 bucket.
So far I have done the following:
Create a bucket with the name app-name.app (domain is .app)
Make the bucket public and set property as a static website.
Website works fine when directly accessed through the S3 ARN.
Now I need to direct my (Godaddy) hosted domain name to this S3 bucket.
These are the steps I've taken:
Create a hosted zone in Route 53
Create record sets for A, NS and SOA types.
This is how it looks like:
After that I set the same NS server names in to Godaddy domain. I then also received an email from Godaddy stating that the nameservers have been changed.
However, I am not able to access the site through the domain name. It times out.
Appreciate some help figuring out what step I am missing.
Thank you.
1-Make sure your DNS changed correctly, by ping and trace.
2-Use DNS tools like mxtoolbox to check the records.
3-Add CNAME record with your S3 website public URL(It's different as S3 general URL), for example, add www.

AWS: Linking static website to domain name on Route53 of different AWS account

I've been having issues in linking a static website hosted on S3 bucket in one AWS account to a custom domain name regsitered on Route53 on another AWS account. Is it not possible to do such types of linking, where the S3 bucket and the Route53 are on two different AWS accounts? If so, what could be the solution for my case!
Thanks in advance.
An A-record alias is needed at the zone apex (e.g. example.com) but not for subdomains (e.g. www.example.com, because here, you can use a CNAME instead) when hosting a site on S3, and this doesn't work across AWS accounts.
However... there's one word in your question that leads me to believe the following solution may be useful. The word is "registered."
custom domain name regsitered on Route53 on another AWS account
If the domain is registered by the Route 53 registrar under one AWS account, you can still create a Route 53 hosted zone on a different AWS account -- the one with the bucket -- and then change the authoritative nameservers in the Route 53 console in the first account. This delegates operational control to the second account.
Create a hosted zone for the domain in account 2 (the same one as the bucket). Make a note of the 4 NS records that Route 53 assigns to the hosted zone. Do not change them. Just note what they are. Configure this hosted zone with the appropriate A record alias pointing to the bucket.
Then, in account 1 (where you registered the domain) in the Route 53 console, click "Registered Domains."
Select your domain.
Choose "add/edit name servers."
Enter the values for the Route 53 name servers that were assigned by Route 53 for the new hosted zone in account 2.
Wait a few minutes.
Test.
It will probably take at least 15 minutes for this to start working (it can theoretically take 48 hours but this is very unlikely), and after this, you can remove the hosted zone from account 1. Its configuration is ignored, anyway, if you don't.
Route 53 will continue to bill account 1 for the annual registration, but will bill account 2 for the hosted zone. Neither account will be charged for the DNS queries, but account 2 will be billed $0.00 for them, since the queries are against an alias pointing to S3, and in such cases, queries are free.
This should work just fine. It doesn't matter that the Route 53 entry points to a bucket in a different account.
You should follow these directions: Example: Setting Up a Static Website Using a Custom Domain with a few changes...
Basically:
Create a bucket with a name that matches your domain name (eg images.example.com) and activate Static Website Hosting
Copy the Endpoint presented. It will look like: images.example.com.s3-website.amazonaws.com
In Route 53 (in any account), create a Hosted Zone for your domain (eg example.com)
Within the Hosted Zone, create a Record Set for images.example.com of type CNAME. Then enter the Static Website Hosting Endpoint that was copied above.
Then test the domain. For example, images.example.com/foo.jpg should return the foo.jpg file from your bucket.
It is not possible to use Alias=YES for a Static Website in a different account.

Redirecting route53 purchased domain to s3 bucket?

I've just purchased a domain from Route 53 and created corresponding buckets in AWS s3. I've followed the instructions from: Example: Setting Up a Static Website Using a Custom Domain.
Let's say my custom domain is called customdomain.com.
I've created customdomain.com and www.customdomain.com buckets in s3 and allowed static website hosting on customdomain.com and enabled redirecting from www.customdomain.com to the customdomain.com bucket.
When I enter the endpoint for customdomain.com it works just fine, meaning my bucket policies are working correctly.
Next, in Route 53, I've set up Hosted Zone for customdomain.com.
I've also created a record set in that hosted zone with the name:
customdomain.com, type A, aliasing to customdomain.com's endpoint (which I chose from the dropdown menu). I left everything else as default then saved it. I added the record for www.customdomain.com but had it alias to customdomain.com
When I try to access customdomain.com, Chrome states that the site can't be reached.
Did I miss a step somewhere or does it take time for my site to be up due to DNS propagation or something?
Fixed it.
Apparently, the domain's name servers weren't the same as my hosted zone's name servers

Amazon Route 53 Alias not working

For some reasons I am not able to set up my static website in S3.
I am trying to resolve this from last 2 weeks but its not working for me.
What I have done is:
Uploaded files within S3 bucket.
Set up routing policy - thats fine.
Alias target dropdown - I can see the S3 endpoints.
Created Hosted zones.
Set up both the alias with and without WWW.
Result - When I am typing URL in the address bar, it throws an error..either site is down or DNS related errors.
I tried implementing the same steps 6-7 times,No problems at all but domains are not working in the end. Absolutely clueless where I am going wrong?
Your hosted zone and domain name servers could be out of sync:
In Route 53, verify the Name Servers (NS) generated by your Hosted Zone match what's listed under your Registered Domains.
SCREENSHOT: AWS Route 53 Top Left Menu - Hosted vs Registered Domains
Click on "Hosted Zones"
Select your domain (example.com)
Select the "Record Set" with type NS
Copy each line item / name server from the value box
ns1.amazon.com
ns2.amazon.org
ns3.amazon.net
ns4.amazon.co.uk
Now click on "Registered Domains"
Select your domain
Past each entry in the upper right hand corner
SCREENSHOT: Paste example.com Name Server Entries
The major steps to create an Amazon Route 53 alias to an Amazon S3 bucket are:
Create a bucket with the DNS name (eg images.my-company.com) -- note that the Bucket Name must match the DNS that you wish users to enter when accessing the URL
Activate Static Website Hosting on the Amazon S3 Bucket
In Route 53, create a Hosted Zone or use an existing Hosted Zone
Create a Record Set in the Hosted Zone
Name: Match the subdomain to the name of your S3 Bucket
Type: A
Alias: Yes
Alias Target: Select your S3 website from the pull-down list
See: Setting Up a Static Website Using a Custom Domain
The most important part is that the Bucket must have the same name as the Route 53 domain name (eg images.my-company.com).
If problems are experienced, first try to access the content via the Static Website URL. If that works, resolve the URL (eg via DNSLOOKUP or PING) and compare the IP address to a resolution of your domain name. They should both return the same IP address.
I find a solution.
It seems I deleted my hosted zone which was created by amazon first time against my domain name.
Later when i created my hosted zone again against same domain name I am supposed to update nameservers in the hosted zone page which resolved the conflict of name server resolution
In my case it was a silly Error, I was using my earlier bookmark which was using HTTPS. As soon as I used HTTP, it worked. (ps: Prior to trying this I was routing via cloud front.)
As AWS documentation,
https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/RoutingToS3Bucket.html
An S3 bucket that's configured as a website endpoint doesn't support
SSL/TLS, so you need to route traffic to the CloudFront distribution
and use the S3 bucket as the origin for the distribution.