1

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?

1 Answer 1

1

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)
2
  • 1
    If your DNS provider does let you put a CNAME at the Apex of a zone, then you have a DNS provider that doesn't understand how DNS works. This is an invalid configuration, always and everywhere. Cloudflare doesn't create a real CNAME record. Their "CNAME flattening" feature actually creates an A record and does a back-end lookup, similar in behavior to a Route 53 alias. Some providers call this an "ANAME" which is not a real RR type, but is similar to what Cloudflare is doing. Commented Aug 22, 2017 at 1:50
  • There are multiple instances where using a CNAME for ELB will not work. Some service require an A record and not a CNAME. The advantage of Route 53 is that it allows "alias" records that appear to be A records, but in the backend point to another AWS service. This is the case for both ADFS SSO, and E-mail servers (to avoid spam filtering). Commented Aug 22, 2017 at 2:17

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.