A(Host) Records with AWS Load Balancer

You need a web server that does a redirect instead. i.e. you want to send a 301 "Moved Permanently" from the web server that mysite.com points to, redirecting to www.mysite.com. Then you CNAME www.mysite.com over to Amazon.

Some DNS hosting providers will do this for you, I think GoDaddy does. Otherwise you need to set up a web server you can configure to do this.

The Apache configuration in .htaccess could be for example:

RewriteEngine on
RewriteCond %{HTTP_HOST} mysite.com
RewriteRule ^(.*)$ http://www.mysite.com/$1 [L,R=permanent]

If you have a generic Apache-hosting site that supports .htaccess then you could do that.

Anyway what you're looking for is a redirect.


Here are the steps.

  1. Click create record set
  2. For zone apex record just leave the name field blank
  3. Select the type of alias you want to make A or AAAA (all steps after this are the same for both types)
  4. Select the yes radio button.
  5. Open the EC2 console in another tab and navigate to the list of your load balancers. Click on the load balancer and look at the description tab in the pane below the list. Sample output below

enter image description here


Technically, it can't be done. You can only refer to an Amazon load balancer using a CNAME and it breaks DNS rules to assign a CNAME to the root of the domain because of issues this causes with MX records.

That said, some DNS provider do allow you to do this, Amazon's route 53 doesn't, but Zoneedit allows it (with a warning). If you don't need your email to work for that domain, this is a solution. If you do need email, mine did happen to work using Zoneedit, but the DNS rules says you can't rely on this.

Edit: After my post Amazon added the ability to map the root of a domain (a.k.a. the zone apex) to a load balancer using Route 53. See this blog post.