Search code examples
amazon-web-servicessubdomainforward

Sub Domain forwarding to IP address of EC2 instance


I have an ubuntu server running on Amazon EC2. I want to set my subdomain to serve from this instance.

I have assigned an Elastic IP to the instance. From my domain provider I have forwarded this subdomain to the Elastic IP of the ubuntu instance.

When I try to open my website using my subdomain it is served from the IP instead of the subdomain.


Solution

  • You should setup an "A" record for the subdomain and point it to the elastic IP. You may have created a CNAME and pointed it to the IP instead.