Most of the times DNS does what you expect it to do with little or no fuss (well, ok, sometimes with a little more fuss) but we strive to make DNS as easy as possible at DNSimple. Today I’d like to introduce a new record type that we’ve added to make pointing to dynamic hosting services a little less painful. This record is called an ALIAS record.
Dave Winer wrote up a good explanation for the ALIAS record:
CNAMEs are wonderful. It would be great if everything could be a CNAME. Obviously some names have to point to IP addresses, or nothing would resolve.
DNS has a limit. The top level of a domain must be an A record, it cannot be a CNAME. For example, scripting.com cannot be a CNAME, it must be an IP address, because that’s what the value of A records are. IP addresses.
However if I use dnsimple.com, I could make the value of scripting.com an ALIAS record whose value is s3.amazonaws.com. Then, when a request comes in to lookup scripting.com, it looks up s3.amazonaws.com, gets an IP address and returns that. The caller doesn’t know or care how they got the address.
Thanks, Dave, for the excellent explanation.
Let’s take a look at an example using a site deployed on Heroku. Up until recently, if you used the DNSimple one-click service for Heroku we’ve added 3 A records pointing to Heroku’s servers. This works, however it isn’t the best set up because if Heroku ever changes one of their IP addresses, or adds a new address, then your service will start failing sporadically. Additionally, if Heroku needs to make temporary changes then your app may start failing while those changes are in place.
With the new ALIAS record, you can point your domain to a single host name (such as the proxy.heroku.com CNAME record) and we will return the IP addresses associated with that host name as if they were your own. Whenever proxy.heroku.com changes the A records returned for your domain will change along with it, without any need for your intervention.
This would also work for an Amazon Elastic Load Balancer or S3 host name. If you point your domain to one of those hosts with an ALIAS record it will return the current A records for that host and will update when the host updates, using the time-to-live specified by the host.
One might compare this to a CNAME, however there is a significant difference: a CNAME record must be the only record for a particular name. This means that you cannot use a CNAME for your second-level domain as it must include NS records and an SOA record. You *can* use an ALIAS record though as that will effectively be converted to A records behind the scenes by our name servers.
Note that if you are pointing a subdomain to another subdomain in the same domain (i.e. foo.example.com -> bar.example.com) then you should use a CNAME record.
We’re still working out some of the details of ALIAS records, but we do feel that they are a very useful addition to the records supported by DNSimple. Please feel free to contact us at support@dnsimple.com if you have any questions or issues with the ALIAS records, or any other questions about or domain and DNS services.
Awesome news guys!
Very nice, this is how DNS aliasing should’ve been implemented from the very beginning.
Ps: will it mirror other records like AAAA and MX?
@Big Al,
Not right now. For the moment it only resolves CNAME and A records. I could see expanding it in the future to answer AAAA requests as well and perhaps others. For MX, once you’ve added an ALIAS you no longer need to leave off other records, so you can legitimately include MX records on the root with your ALIAS record. Having said that I am open to enhancing it in the future for support of a wider range of records if it makes sense.
I think right now I actually prefer using an ALIAS both for the top level and for the subdomains. Do you think there would be any issues with that?
We set it up this way (after a lot of head scratching) because we wanted to point a subdomain to heroku but rout the e-mail for that subdomain somewhere else. A CNAME record does not work in that case because it overrides the MX record we want to maintain.
OK, to be sure: Does this mean I can use something like MyWonderfulSite.com to point to BunchOfMumboJumbo.aws.amazon.com if I put a site on S3, rather than http://www.MyWonderfulSite.com?
@Buzz
Yes, that’s one use.
Hi,
I don’t understand if it’s something that already exists but is not widely used, or if you’re creating something specific to DNSimple.
Anyway, it seems to be a great improvement, and I definitely see where I could use it.
An ALIAS is not a real DNS record, rather it is a virtual record that causes additional processing to be done on our authoritative name servers. At the moment the only two cases where I know of it existing is at DNSimple and at Amazon Route 53 (specifically for Elastic Load Balancers).
Thanks! I signed up yesterday for this feature. I like Amazon Route 53′s ALIAS for Elastic Load Balancers, but it doesn’t work for CloudFront, S3, or arbitrary CNAMEs.
“This would also work for an Amazon Elastic Load Balancer or S3 host name”
But wouldn’t S3 have to respond to apex domain requests for this to work? If it does behave this way, then it had that behavior before there were any products on the market that supported it… or maybe they just made it work along with subdomains because it would have taken them extra effort to warn the user.
@John,
You can have S3 respond to the apex by using a host name like this in the content part of an ALIAS: example.com.s3.amazon.com in conjunction with a bucket named example.com.
I’ve set up an example here: http://dns-for-rubyists.com/
Hey Anthony –
The Heroku app I’m building aims to let my customers use their own domain with my service. We are definitely going to be using DNSimple’s API to let our customers register a new domain through our web app.
For the domains that we’ve registered through you folks, this blog post makes it clear that you folks have created a wonderful solution to point a second-level domain (e.g. example.com) at Heroku reliably since ‘A’ records are unreliable and CNAMEs aren’t exactly a valid spec for naked domains.
However, here’s the problem I have: Do you folks offer any solution to this problem for my customers who already have a domain name registered at another registrar and want to use it with my Heroku app?
Sahas,
You can use our DNS hosting for any domain, even those that are registered with another registrar. Just add the domain to our system without registering or transferring, set up the DNS records and then change the nameservers at the current registrar to point to ns1.dnsimple.com through ns4.dnsimple.com and you’re done. You can also purchase SSL certificates for domains not registered with DNSimple. Feel free to ping support@dnsimple.com if you ever need any help with either of these things (or anything else domain and DNS-related for that matter).
Sincerely,
Anthony Eden
[...] of night when your sleeping after a long hard days work). Thankfully, the folks at DNSimple have a solution, the ALIAS record. In short, the ALIAS record gives you the benefit of an A Record, being able to [...]
[...] mentioned in that page, but linked in its references, is a blog post by DNSimple introducing ALIAS records. This is something that, as far as I can tell, only DNSimple has implemented, and it basically [...]
Hi,
After reading this article feeling of learned knowledge.At the same time, I have a question, the ALIAS record the first step is CNAME, and then resolve CNAME pointing to domain name address, [for example dnsimple.com cname tmp.dnsimple.com], if tmp.dnsimple.com return different for different regions A record, it should be how to deal with it?
[...] account because that’s the way that heroku allows naked domains to function. DNSimple sets up the ALIAS record for you rather easily, but what it doesn’t do is warn you if you have both MX and CNAME [...]