Pointing domain to AWS Classic ELB DNS Name without using Amazon route 53

amazon-elbamazon-route53cname-recorddomain-name-system

I have a domain example.com.
I want to point this domain to my AWS internet-facing classic ELB public DNS (my-elb-123456789.us-west-2.elb.amazonaws.com) without using Amazon Route 53.
How should i configure elb DNS in my domain (example.com) DNS records as a CNAME?
Then what is my 'A' record in DNS configuration?

Best Answer

You can use any DNS provider to direct subdomain traffic to an AWS load balancer. Create a CNAME record that has the value set to the ELB CNAME. This has to be a subdomain with most DNS providers - the www subdomain would be most common. AWS Documentation.

Setting the domain apex to point at the ELB is more difficult. You can't use an A record as the IP of the ELB changes, and you can't put a CNAME at the domain apex as it's against the DNS specification.

Some providers let you create something similar to a CNAME at the domain apex, including Route53 and CloudFlare, in a way that meets the DNS specification.

If your provider won't let you set a CNAME at the domain apex you'll have to create an A record and some kind of redirection. Some options include:

  • A t2.nano EC2 instance with Nginx returning a 301 redirect
  • CloudFlare and a page rule (though if you're using CloudFlare it's better to use the solution above)
  • S3 bucket redirection (only works on http, not https)