Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

I have a GoDaddy domain name for example

I want my domain name 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 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?

share|improve this question
You can do all sorts of things, but why would you want to? Just setup the webserver on your EC2 instance to serve 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 – syedrakib 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 into so you'd have - 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 with a DocumentRoot of /var/www/html/a_sub_directory/. This way 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 and 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

share|improve this answer
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? – syedrakib 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 posting your answer, you agree to the privacy policy and terms of service.

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