Ubuntu – amazon ec2 pointing domain name to elastic ip and setup ssl

amazon ec2apache-2.2routerUbuntu

I am new to amazon ec2 however I managed to run EC2 instance and connect elastic ip to that. Now I bought a new domain name, I thought i need to use amazon route 53 service to point my domain name to the ip.

I did so and changed A record. Now when I try to open url "i-loveit.info" it opens with www.i-loveit.info but if I open url http://i-loveit.info … then i get page not found error. Anybody know where I am making mistake and how can I solve. All I want is to point my domain name to amazon EC2 ip permanently.

Best Answer

Firstly, you do not need to use Route53 as your DNS provider - any DNS provider will do - you can even host you own DNS servers (although, good practise is to have at least 2 redundant servers hosting DNS).

Your registrar needs to be made aware of the name servers you are using (which you appear to have done). On these name servers, you need to point the domain in question to your elastic IP address.

For your domain name, you will use an A record to point it to your elastic IP For any subdomains, you will likely use CNAMEs to point to your domain name (although, in some cases, A records may be appropriate).

DNS records (A records, CNAMEs, etc) need to be added on your DNS server (in this case, Route53) - if you are using the AWS console, there should be an option to create a record set - select an A record (ipv4) and you should be able to leave the 'name' as the default (just your domain name, without a subdomain).

A quick dig of your domain, suggests that there is an A record setup for the www subdomain, but that there is no A record for the top level domain. So, when a lookup is performed for the www subdomain, the nameservers return the correct IP address, and you can connect to the EC2 instance. When you lookup your main domain though, no IP address is returned, and no connection is established to the EC2 instance.

Update: It looks like you have it figured out - at the moment, your domain is loading (second level domain), but not your www subdomain, and a dig shows that you now have an A record for your domain, but none for your subdomain.

Related Topic