How to config Amazon Route53 working without www in sub-domain

33,272

Solution 1

You can't use a CNAME for the root-level domain, it violates the RFCs and can cause a number of problems. Unfortunately, Amazon doesn't have a workaround for S3-hosted websites.

edit: Amazon now supports this. http://aws.typepad.com/aws/2012/12/root-domain-website-hosting-for-amazon-s3.html

There are services like WWWizer that you can use to redirect to the WWW, but they're not a perfect solution.

Solution 2

Create a resource record set (Type A - IPv4 address) that "has the same name as the hosted zone by leaving the Name field blank".

Amazon Route 53 - Edit Record Set

This is the warning Route 53 gives when trying to add the name "@", which I was custom too using for Bind nameservers. So don't use '@', use an empty name ''.

Solution 3

If you want to point your root domain mydomain.com.br to service from AWS:

  • create a record of type A - IPv4 Address.
  • then select Yes for Alias.
  • Alias Target will list autocomplete for your AWS resources.
Share:
33,272

Related videos on Youtube

romuloigor
Author by

romuloigor

• Amazon AWS (R53, EC2, S3, RDS, EBS, AMI, ...) • Python 2.7.x • Django 1.3.x • Ruby 1.8.5 for Google Sketchup Ruby API • Linux Ubuntu, RH, CentOS, Amazon Linux • JavaEE, JBoss6, Mod_JK, Tomcat6 • Hudson, Jenkins, Sonar, Selenium • CVS, SVN, GIT • OSX 10.x.x

Updated on September 18, 2022

Comments

  • romuloigor
    romuloigor almost 2 years

    edit: Amazon now supports this. http://aws.typepad.com/aws/2012/12/root-domain-website-hosting-for-amazon-s3.html

    I have my domain config in Route53 at Amazon AWS

    exec ping command in my domain without www

    $ ping mydomain.com.br
    ping: cannot resolve domain.com.br: Unknown host
    

    exec ping command in my domain with www

    $ ping www.domain.com.br
    PING s3-website-sa-east-1.amazonaws.com (177.72.245.6): 56 data bytes
    64 bytes from 177.72.245.6: icmp_seq=0 ttl=244 time=25.027 ms
    64 bytes from 177.72.245.6: icmp_seq=1 ttl=244 time=25.238 ms
    64 bytes from 177.72.245.6: icmp_seq=2 ttl=244 time=25.024 ms
    

    Route 53 -> Create Record Set -> Name: [ ].domain.com.br Set CNAME value: www.domain.com.br

    DISPLAY ERROR

    "RRSet of type CNAME with DNS name mydomin.com is not permitted at apex in zone mydomin.com"

    • Michael Hampton
      Michael Hampton over 11 years
      Hi, please note that answers should be provided in the Answers section below, NOT as edits to the question.
  • James Park-Watt
    James Park-Watt over 11 years
    You CAN use CNAME's with root-level domains it does not violate RFC. The problem is that CNAME can not co-exist with other records e.g. MX. From RFC1034...... If a CNAME RR is present at a node, no other data should be present; this ensures that the data for a canonical name and its aliases cannot be different. This rule also insures that a cached CNAME can be used without checking with an authoritative server for other RR types.
  • ceejayoz
    ceejayoz over 11 years
    @JamesPark-Watt blog.cloudflare.com/… "The problem is the DNS RFC (RFC1033) requires the "zone apex" (sometimes called the "root domain" or "naked domain") to be an "A Record," not a CNAME."
  • romuloigor
    romuloigor over 11 years
    Perfect -> link Root Domain Website Hosting for Amazon S3
  • Andrew B
    Andrew B almost 9 years
    Apex CNAMEs are not legal. It's been explicitly spelled out in RFC2181 for awhile now.
  • Rubens Mariuzzo
    Rubens Mariuzzo about 7 years
    And now using the @ works for A record to get a naked domain.