-3

Am a novice in DNS related configurations. I have a domain registered in godaddy which i want to point to a website hosted in one of my amanzon ec2 instances.

so i want to map mydomain.com to http://54.214.111.76/mysite.

The solutions i've tried

DNS Forwarding

I've forwarded the dns to http://54.214.111.76/mysite. And typing mydomain.com successfully redirected to my site. But the url now pointed to http://54.214.111.76/mysite and not mydomain.com. As i understand that it forwards but what i really wanted is, the dns should point to my site and i want the url to remain as mydomain.com.

Mapping IP to A Record

I've pointed A record to ip 54.214.111.76 (as only ip can be given there not ip/mysite). Now it successfully stays there in mydomain.com, but the apache homepage is what displayed.

So what i want to do is to point to 54.214.111.76/mysite, but the url should still remain in mydomain.com. It's a small prob for techies i understand ;). Thanks in advance for helping me out. Cheers!

Vivek
  • 93
  • 8

2 Answers2

2

You can't map a DNS A record to a URL.

You need to use something like name based virtual hosts or host headers on your web server to direct the incoming traffic to the correct website.

joeqwerty
  • 108,377
  • 6
  • 80
  • 171
1

Thanks guys for your help. i solved the problem myself. Here is what i did (not sure if this is the right way)

  • Login to godaddy
  • Click on 'Manage DNS'
  • On the Right bottom you will find an option for "Forwarding"
  • Click on "Add"
  • Give your url in the text box given there without http or https. For ex if you want to redirect to "http://54.214.111.76/mysite", choose http in the first combo and type 54.214.111.76/mysite in the second text box.
  • Choose Forward Type as "Permanent (301)"
  • Choose Forward Settings as "Forward with Masking"
  • And give the Masking Title as "http://example.com" (This will be the text that will remain in the url on all requests to that domain.
  • Check Option "Update my nameservers and DNS settings to support this change."
  • Click on Save.

This will take some time and now when you just give example.com you will be redirected to your site internally and the url will just remain as mydomain.com. This is what i exactly wanted.

Cheers!

Vivek
  • 93
  • 8