System Administration & Network Administration
amazon-ec2 amazon-web-services godaddy amazon-elb
Updated Wed, 21 Sep 2022 13:25:27 GMT

how to forward godaddy domain to ec2 load balancer


I have a domain with godaddy: example.com

I have an ec2 load balancer pointing to an ec2 instance.

I would like to example.com to point to my load balanced instance.

I first added a www cname record for my elb DNS. Then I forwarded example.com to www.example.com

What do I put in the A Name record on godaddy?




Solution

You can't.

ELB provides one -- or more -- IP addresses, hiding behind the CNAME you are using with www record, and these addresses are not static, so you can't create an A record at the top ("apex") of your domain and point to the addresses... along with that, a CNAME at the apex of a domain is not a valid DNS configuration. So there isn't directly a way to do this.

You can either use Go Daddy's web site forwarding feature to redirect example.com requests to www.example.com, which will cause the browser to change its address bar value from example.com to www.example.com and then send traffic to the ELB (via the www CNAME)... or you can move the DNS from Go Daddy to Amazon's Route 53 service, which has another feature that operates similarly to a CNAME but is implemented differently, consistent with the rules established in RFC-1912. They call these ALIAS records.

An Alias record in Route 53 is a pointer to internal configuration within Route 53 that allows that service to look up and return an appropriate A-record for the service to which the Alias record is pointing.

http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/CreatingAliasRRSets.html