I have an Elastic IP for my EC2 instance for example.

I have a GoDaddy domain name www.example.com for example

I want my domain name www.example.com to load pages from -- I have two queries about that.

  1. The other forums I browsed through (ServerFault and Quora) suggest I need to re-write the A Host's @ record to the Elastic IP that's connected to my EC2 instance. What if I want the domain name http://www.example.com to load up my page at instead of the root directory at

  2. GoDaddy domain manager has something called "Forwarding with Masking". Can I use that feature to load up my EC2 hosted instance from my GoDaddy domain name INSTEAD of changing any A record or anything?

  • You can do all sorts of things, but why would you want to? Just setup the webserver on your EC2 instance to serve www.example.com out of whatever the actual docroot is. – womble Jul 5 '12 at 11:49
  • i DID setup the webserver on my EC2 instance.......... I am trying to figure out how to connect my GoDaddy domain name with EC2 instances which is ALREADY serving my pages globally via elastic IP – Rakib Jul 5 '12 at 12:20
  1. Your elastic IP will allow you to have which can be visited by anyone. However, A records are at the DNS level, they only allow you to point example.com into so you'd have http://example.com/a_sub_directory/ - but it's not possible to remove a_sub_directory from this using DNS alone. You need another system.

  2. Yes, you can use this feature. Just forward/mask your domain onto without changing any A records and you'll be done.

  3. A better solution would be to use Apache, and have example.com with a DocumentRoot of /var/www/html/a_sub_directory/. This way example.com will load everything from a_sub_directory but it's clean, and the user is none-the-wiser (it's what everyone does). You will need an A Record into This comes from Virtual Hosting which many HTTP servers (Apache, Lighttpd, etc.) deal with very well - so you have example.net and example.com both on but with two different directories serving their content.

It is worthy to note that forwarding/masking is not "clean". You can see the page load, then the frame load inside. Any links inside the masked frame will be of the form and if a user does a Right Click > Copy Link then they'll get a link, not example.com.

  • by the noteworthy point you mentioned, i understand it's best to re-write the A records to point to my Elastic IP. But the problem is, the root folder of my website is in a subdirectory of my AWS instance. Is there anyway i can make this work? – Rakib Jul 5 '12 at 11:40
  • Yes, please see the third point I added. If you are happy configuring Apache, this would be the perfect solution. – Jay Jul 5 '12 at 11:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.