I recently purchased a domain on AWS mydomain.com with the intention of creating a record set which can forward traffic to an EC2 instance which I also have running. However, when I try to access mydomain.com from a web browser, I get the error that the site cannot be reached.
The record set I created for this domain was myapp.mydomain.com. I configured this to point to my EC2 instance. When I try to access this domain from a web browser, I get a 502 bad gateway error.
Can someone explain what is going on here?
You will need to start by creating a zone in Route53 for the domain - so mydomain.com, NOT anything else.
Once that has been created, there will be 2 records: SOA and NS.
Using the "Registered Domains" screen, click on the domain and make sure that the name server records match the NS records in the zone you created.
Once that is done, you should be able to create a new A record in the mydomain.com zone for myapp.mydomain.com that points to the IP address of your EC2 instance.
The answer given by #chris, which closely follows the official documentation from AWS, is in general the best answer to this question. However, in my case, the 502 error I saw was being caused by that I did not open port 8080 on which my Tomcat server was listening. By adding a custom TCP rule to open port 8080 I was then able to reach my Tomcat.
Related
I have deployed a django based website on my AWS lightsail instance. the web address has a port 8000 (:8000). I own a domain on (host =fatcow.com). I have created a hosted zone on AWS and pasted the ns values to my provider(factor)'s Nameservers values. In the amazon route53, I have created a new record with a simple redirect A ipv4 and entered the resolver IP address value - my web address with port value. it doesn't work.
Also, I have read that the redirect will not work for its with port numbers. I have tried redirecting my domain to the static ip, then created another hosted zone record trying to redirect the static ip to the ip+port value - error pops up saying it is not a valid address.
I currently use the development server provided by django as it is a personal website and currently it will not have a lot of traffic - portfolio website.
Also, on my fatcow.com domain settings, the Nameservers are updated and in the whois values, new Nameservers are seen. I have only added the 4 NS values. AWS also created SOA ip values but I was not able to add them to the domain (Inputs were not taken by fatcow ).
In the NSLookup website, I can see NS values and SOA values which are on the AWS hosted zone but A records show none.
Edit: sorry for the confusion. my domain is www.chandradhar.com. I'm not a web dev but I'm trying to deploy a django based portfolio website. I have added Amazon Lightsail DNS nameservers to my domain (host=fatcow.com). the web address is :8000 port. Without the port number, the website isn't loading at all. Only with the port number along the static IP, the website loads. 'A' record isn't taking the port number. I did add a SRV record with the port number(in AWS route 53) but still doesn't work. when checked from the website nslookup.io, the nameservers are updated correctly
Not reproduceable.
> host fatcow.com
fatcow.com has address 65.254.254.33
fatcow.com mail is handled by 10 mail.fatcow.com.
Most probably your changes in DNS have already propagated.
Steps to successfully deploy one or more websites on lightsail AWS when the domain is on another website like godaddy/fatcow.
Create a dns zone in the networking section of the lightsail instance.
Copy the name servers from the dns zone and paste it in the name servers section of the domain provider (fatcow/godaddy) - it might take upto a day for the values to get updated - i used nslookup.io to see if my nameservers were updated.
Create 'A' records and SRV records pointing to the static ip of the lightsail instance.
Install Nginx
Create a simple script with the (name of the website).conf in the conf.d folder/available sites folder
Add the following script:
server
{
listen 80;
server_name domainname.com;
location / { proxy_pass http://ipAdd:PortNum;
}
}
Repeat the same code block with different domains and redirect ports. I guess we can also use 301 redirect to achieve the same.
This might or might not be the proper way of achieving what I required but it'll work.
I have been trying to connect my domain with my elastic beanstalk instance.
My domain was purchased off GoDaddy and I have updated the nameservers to point to AWS and verified through dig. If dig comes up with the NS, it means GoDaddy is properly configured to point to the DNS right?
The Test Record Set function also does not show any error and has a proper response returned which has NOERROR
Problem is I still receive an ERR_NAME_NOT_RESOLVED everytime I try to load the website on browsers even tried on different devices
I have also checked the alias used in my Hosted Zone and its up and running
What I have already done:
Initialized and created Beanstalk environment - Up and Running
Public Hosted Zone - Created A record for www.mysite.com
GoDaddy DNS NS - updated with AWS 4 nameservers
Checks I have done:
Internal Test Record for A www.mysite.com
Dig Command
What could I be missing?
UPDATE***
So I figured "www.mysite.com' was working but 'mysite.com' alone was not. I'm assuming route53 will automatically use the www A record? But seems like its not?
Hope ya'll could help
Thanks!
Got it to work.
Looks like besides creating a www A record, I had to create a record for the root domain i.e mysite.com in the Record Set of my Hosted Zone
Solved!
Recently, I started searching about security procedures and came across SSL. Actually, I already knew about SSL, but I found to be too expensive at the time.
Luckily, yesterday I found out that Amazon gives SSL certificates for free!
However, I have spent a whole day trying to set it up but it didn't work.
I have a domain registered at GoDaddy, let's assume its www.mydomain.com. My website is hosted, however, on Amazon Web Services (AWS). I also have access to edit the GoDaddy's DNS records and full access to my AWS account. I have seen LetsEncrypt, but my website runs in ASP.NET (IIS Windows) and currently they only support Linux OS.
Here's what I've tried to do:
Get a SSL Certificate from AWS Certificate Manager
I have chosen to setup via DNS, which means I had to add a CNAME record to GoDaddy domain records.
If you look above carefully on the two images, the CNAME record on AWS is on the center of the page. I've added a record as CNAME containing the values.
Add HTTPS to Load Balancer Listeners:
Allowed HTTPS on Security Groups
NOTE: Both Inbound and Outbund rules are just like above. I have also set the Load Balancer and my Running Instance to use this security group.
Added records to Route 53 Hosted Zones
The A type record points to my instance IP.
The NS record was generated by Amazon (I added GoDaddy's Name servers as well).
The SOA record was generated by Amazon and I didnt touch it.
The CNAME was added by me, It's again the SSL protocol.
I don't know what else to do or if I have a wrong setup.
If I'm not mistaken, you have an EC2 instance behind an ELB (Classic/Application/NLB), requested an ACM certificate which has been issued successfully for *.mydomain.com, created HTTPS listener to use the SSL certificate but getting connection time out on port 443.
The issue is the DNS record of mydomain.com still points to the EC2 instance's IP, which might not be listening on port 443 (and the ELB is not being used at all).
So, to resolve this, you have to use the ELB's DNS name and use it as CNAME in your DNS record (not sure whether in Route 53 or GoDaddy because I don't know which is authoritative NS).
Also, you might consider requesting a new certificate with mydomain.com and *.mydomain.com and update the listener because ACM cert with *.mydomain.com does not protect mydomain.com.
I have a domain registered at godaddy but want to have webhosting at AWS Amazon. As per the instructions, updated the 'A' record with Elastic IP of AWS. But the website is down and not able to connect. Thanks in advance for any help. Am I missing anything on AWS EC2 VPC? I am not using Route 53 since this is not required as per AWS documentation.
please check your application should hosted in port 80. Can you able to access your application IP:80 from browser..?
Please check the port you are running your application on. If your domain name is somexyz.com and your port is other than 80 (standard TCP port for HTTP service) like 5000 for default Flask werkzeug dev server, you will have to type somexyz.com:5000 on the browser to access your website. Otherwise run it on 80. The stackoverflow discussion here- create a domain name pointing to an IP of port different than 80 should help.
(Also, this may be irrelevant now but the TTL field~600secs etc on godaddy reflects avg time for DNS records to get updated when we edit zone info 'A' field to point to Amazon Ec2 Elastic IP. So waiting for upto an hour or so helps.)
It's been couple of days that I transferred my domain name from one AWS to another--dev environment to production. The problem is, the domain name isn't showing up in any DNS (Amazon or Google). I'm pretty sure I've configured the hosted zone correctly.
I'm also trying to verify SES which is failing and I also set MX records (Gmail) which don't work. The MX records and SES were set couple of days ago. Additionally, I created an A record to point to a elastic load balancer DNS name.
Any suggestions on what might be the problem? It's been couple of days and from past StackOverflow posts as well as past experience, DNS propagation on Amazon's server doesn't take more than 15 minutes.
EDIT:
Here is a timeline of events which can provide more information:
I had a domain abc.com on AWS account user1
The domain was transfered to AWS account user2
As of right now, the following hosted zone is created on user2's account:
The one thing this record set is missing is a CNAME to the load balancer which I had setup when the domain belonged to user1. However my understanding is that an A record should be good enough and it was a mistake on my part.
I'm using Windows and so I've flushed my DNS. I've tried looking up using AWS's DNS servers and Google's DNS server and nothing.
C:\>nslookup abc.com 8.8.8.8
Server: google-public-dns-a.google.com
Address: 8.8.8.8
*** google-public-dns-a.google.com can't find abc.com: Server failed
It's been a couple of days since the domain was transferred. MX records were something I setup immediately and so I haven't gotten an email. If the DNS doesn't have any clue about the domain name, something must be wrong.
NOTE: The domain name is obfuscated to abc.com.
As suggested by #michael-sqlbot, the name servers were different in the console and hosted zone. I updated the name servers to the NS of the hosted zone. I see DNS propagation.