Understand and configure CNAME Flattening
CNAME Flattening allows a CNAME record to be created for the root domain without violating DNS specifications.
NOTE: This will need to be used if you wish to use a naked domain as your custom domain with AmeriCommerce.
How CNAME Flattening works
Per DNS specifications (RFCs), a domain cannot have a CNAME record and another DNS record of a different type if both records would share the same name. DNS RFCs also require an MX record to correspond to a related A record and not a CNAME. This is problematic when you need a CNAME for your root (for example, a CNAME from example.com to example.herokuapp.com) but also need another type of DNS record at the root domain such as an MX record for mail delivery.
Typically, the aforementioned situation would cause problems receiving email. However, CNAME Flattening ensures the chain of CNAMEs is followed to an A or AAAA record to allow mail delivery while still adhering to DNS RFCs. The CNAME responses are cached and DNS TTLs are respected.
The Inflexibility of DNS
Traditionally, the root record of a domain needed to point to an IP address (known as an A -- for "address" -- Record). While it may not seem like a big deal, tying a service to an IP address can be extremely limiting.
The supply of IP addresses is also limited, so, over time, as more domains are registered, IP addresses end up getting shared between multiple customers.
CNAMEs For the Win
The solution is a CNAME. A CNAME is an alias. It allows one domain to point to another domain which, eventually if you follow the CNAME chain, will resolve to an A record and IP address.
CNAMEs work great for subdomains like www.foo.com or blog.foo.com. Unfortunately, they don't work for a naked domain like foo.com itself.
What was needed was a way to support a CNAME at the root, but still follow the RFC and return an IP address for any query for the root record. To accomplish this, CloudFlare extended their authoritative DNS infrastructure to, in certain cases, act as a kind of DNS resolver. What happens is that, if there's a CNAME at the root, rather than returning that record directly they recurse through the CNAME chain themselves until they find an A Record. At that point, they return the IP address associated with the A Record. This, effectively, "flattens" the CNAME chain.
What Can I do?
Most registrars, do not allow CNAME flattening for root domain names, some services such as CloudFlare, Easy DNS , and Amazon AWS, allow some form of name flattening.
AmeriCommerce, partners with CloudFlare, to make use of their CDN's speed and security. CloudFlare offers free accounts, that you can use to manage your DNS, and make use of the CNAME flattening feature.