Hi I bought a domain. Let's call it domain.com. I'm currently developing a web application in a server, an Amazon ec2 instance with public DNS: ec2-123......amazon.com. How do I change the public domain from ec2-123......amazon.com to domain.com?


Voted to move this question to superuser.com as this is not a programming related question.

Written by Adnan

Accepted Answer

When associating a domain name with a computer, there are 3 components that works together:

  1. The registrar (This is where you bought the domain name).
  2. The DNS server. This server replies to DNS requests, and resolve DNS names to IP address.
  3. The IP of the server.

These 3 components very often don't come from same vendor (although, in many cases they do). You would buy a domain name from one registrar, your DNS is hosted by someone else, and the server is hosted another entity.

Let's go backward, and start with #3:

IP address: You need to make sure that the IP address of your server is static. This means that the IP address (4 digits) don't change between shutdown of the server. In Amazon EC2, this is called Elastic IP, and it is very cheap (relative to EC2 instances), or it is free if your server is up all the time.

DNS: You need to have an account with a DNS service. Amazon has a DNS service called route 53. Other vendors I recommend are nearlyfreespeach.net, or dyndns.com. In a DNS service, you define DNS records (typically A records or C records, but there is more). If the domain name you bought is domain.com, you want to have A records for the names: 'domain.com' and 'www.domain.com'. Your DNS service will give you the names of the name servers, or their IP address. Typically there are more than one servers which backup each other.

Registrar: This is where you connect between your domain name, to the DNS server you have an account with. Enter there the name of the name server you got from '2'.

Written by Uri
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki