Say, I host my website on Amazon ec2 server, and Amazon gave a public url:

So how can I map my own domain name (say ) to this website?

Just following the following steps:

  1. Create an Elastic IP on the AWS Panel, then associate it to your instance.  Note that when you turn off your instance for a long time, you need to re-associate your elastic ip to this instance. 
  2. Go to your domain management system (Mine is Goddady).  Add a A record to the DNS record pointing to the elastic IP address assigned in (1). Your domain provide should either give you some way to set the A record (the IP address), or it will give you a way to edit the nameservers of your domain.

If they do not allow you to set the A record directly, find a DNS management service like ZoneEdit, register your domain as a zone there and ZoneEdit will give you the nameservers to enter in the admin panel of your domain provider. You can then add the A record for the domain in ZoneEdit.
The basic service of ZoneEdit is free, you could also use Amazon route 53 or a similar pay-for service, if you preferred.
If you want to host multiple website on your server, read 

Hosting multiple website with Apacha2


Popular Posts