How can I set up DNS for my website? - amazon-web-services

I have a specific DNS problem for my website - I can access my website using its static ip address but not its domain name. Here's a description of my situation:
I registered a website name, say, "xxx.com", at GoDaddy.com, but the web app is hosted on a AWS lightsail Ubuntu instance with a static ip;
In the "DNS Management" page of this same on GoDaddy.com, I specified custom name servers as those provided by AWS
On AWS Lightsail, I then created an "A" DNS record that maps "xxx.com" to the ubuntu instance's static ip: "A" - "xxx.com" -> "x.x.x.x"
I was able to reach my website using "xxx.com" last night, but after rebooting the Ubuntu instance this morning, the domain name is unreachable while the website can still be accessed using its ip address
I have 2 questions -
How would AWS' name servers know that I am the rightful owner of this purchased domain name "xxx.com", by allowing me to map "xxx.com" to a certain ip address?
Did I miss something during the process above that made my website unreachable today using "xxx.com"? Why was it working yesterday but not today??
Any thoughts would be appreciated. Thanks in advance!

I can now partially answer my own question #2, and the answer is DNS propagation.
When DNS changes are made, it might take up to 24 hours for the DNS changes to take effect across the internet. Both name servers and one's local DNS cache will need to refresh first before receiving newly changed DNS records.

Related

Why am I get CGI default page whenever I try to access my AWS instance

I'm new to AWS EC2 hosting, I have created an instance that has a 'cPanel-WHM for Linux' security group name; by using amazon Route 53 I have set a hosted zone, which I use to link with my domain from NameCheap. My domain from Namecheap is pointing to this hosted zone which has an A record pointing to the IP address of my instance. I have logged in to Cpanel direct by using an IP address with port:2087 and adding an index.php file that contains some simple code to display the welcome note. but whenever I go to this domain I get the default CGI page
"cgi-sys/defaultwebpage.cgi"
I have checked my DNS propagation and I have seen the DNS is propagated. I have tried several times, I thought there was a place I mess with instance settings but ended up with the same problem. Is anyone have any idea what is going on? Thanks in advance

Configure a server with Ubuntu 18 to access it from internet

First, thanks so much for taking time reading this question. I am new on linux, and I need some guide.
I basically have a Ubuntu 18 server (AWS EC2). I have the static public IP address and the domain name from godaddy.
The thing is that I am not being able to access my server from the internet using the domain I bought on godaddy. The only way I have to access this server is using the IP Address...
Maybe you can help me answering these questions:
I think that nothing should be done on AWS EC2 to accept my new domain. right?
Is it enough to have just a "A" record on DNS configuration on Godaddy?
Finally, what configuration should be done on Ubuntu 18?
When enter "hostname" I get --> "server1"
When enter "hostname --fqdn" I get --> "XXXX.com" (the domain I bought on godaddy)
When enter "dnsdomainname" I get --> "com"
Could you please tell me what I am doing wrong? I just want my webpage to be accessed by everybody on the internet...
Thanks In advice! :)
I am not sure what you mean by static IP address from GoDaddy the domain name makes sense.
Normally you would want to attach an ElasticIP address to your instance as the public IP that it is assigned will change when the instance reboots. Then you configure the A record in the GoDaddy domain to point to the EIP address, the TTL is normally about 10 minutes for the DNS to reflect so be patient. (This should be enough).
If it still not working after some time you make sure you have an IGW (internet gateway) attached to the VPC and your Security groups and NACLs allow inbound and outbound traffic.

Amazon EC2 link to Bigrock domain name

I have a simple question for pointing my Bigrock Domain name to Amazone EC2.
I have Created HostedZone from Hostedzone-create link
I got 4 name servers.
Now what?
Suppose my domain name is example.com on Bigrock.com.
Can anyone explain me how can i point that domain name to EC2?
I asked to Bigrock support but they told me something like this:
The website is not working because the DNS zone for your domain is not
configured properly on your Hosting providers DNS servers ( AWS Server
). Please get in touch with your provider for further assistance.
But I am not getting what they want to say. Please help!!
To move your Name Servers to AWS Route 53 first you have to change the Name Servers in Bigrock follow this steps.
http://support.hostgator.com/articles/hosting-guide/lets-get-started/dns-name-servers/how-to-change-name-servers-with-bigrock
Once that is done go to AWS Route 53 and create two record sets one for the "naked domain" and another for "www" domain and add a A-Record to point to the EC2 IP address (Be Sure the IP address is Elastic just in case for future change in IP address of the server so that you are covered).
This is Route 53 Guide
http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-creating.html
Now, you will go to your bigrock.com and find your domain. Change the default name servers information with that 4 name servers information provided by Route53 on amazon. save your changes and wait for few hours to be activated properly.

Linking Amazon Route 53 Domain Name to EC2 instance

I have registered a domain name with Amazon Route53 and I'm trying to link it to an EC2 instance. I'm unable to do this successfully. I have read documentation many times over, I have looked at many tutorials online, I have read many stack overflow answers. I still haven't been able t figure it out. Help will be greatly appreciated.
What I have done so far:
Launched EC2 instance and installed LAMP stack. I'm running a web app on the instance.
Associated an Elastic IP to the instance and I'm able to reach my web app using this IP address.
Registered domain name with Route53
Created a Hosted Zone with the same name of registered domain
Created a Record Set with the following info:
Name: example.com (of course not literally, I have my domain name here)
Type: A - IPv4 address
Alias: No
TTL(Seconds): 300
Value: Elastic IP of EC2 instance
Routing Policy: Simple
This is the point at which I am stuck. When I run nslookup example.com DNS server name in terminal I get the desired response. Running dig domain name, as expected returns no answers. How do I finally connect the Hosted Zone to my domain name to get the latter pointing to my EC2 instance?
Documenting the solution as an answer. It sounds like you got everything correct except hooking up the hosted zone Name Servers to the domain name. This is done via NS Records. When you create a new hosted zone, it automatically assigns you Name Servers. To link the two together, you need to enter the NS records under the "Registered Domains" area.
1. First get the NS records from your hosted zone
2. Copy those records to the appropriate domain under "Registered Domains".
Note: NS Record TTL (time to live) can be as high as 72 hours (rarely), so it could take a significant amount of time for the change to be reflected in a lookup tool like dig (or browser).

Domain name not showing up in DNS

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.