News for hackers. Stuff that matters.
Re:Last Call: HTTP2 by tonyarkles on Thursday January 01, 2015 @09:02PM (#8825184)
What is a "floating apex record"? I googled it in quotations, and you appear to be the only person who has ever said that combination of words in Google's index.
Re:Last Call: HTTP2 by inopinatus on Thursday January 01, 2015 @11:30PM (#8825519)
An apex record is one at the root of a DNS zone. Sometimes called "naked domains".

For example, in "https://github.com/" they are the records particularly for "github.com", rather than for subdomains that might exist such as "www.github.com" or "gist.github.com".

Apex records have a particular restriction: they cannot be aliases, because the apex includes DNS metadata that is not allowed to be aliased[3]. Read on for how this becomes a problem.

I've used the term "floating" as a visual metaphor, because what I'm about to describe lacks a universal standard name, because it is an ugly hack:

HTTP resolves endpoints using host records, so an URL of "https://github.com" means looking up A and AAAA records for "github.com". Yes, the protocol is arrogant enough[1] to assume that your host address for the whole domain is that of the web server. (This is why we ended up prepending "www" to domain names, as a service selector). In response to the query you get an IP address.

Unfortunately, IP addresses sometimes change without warning. The most common example today is the loadbalancer offered by Amazon Web Services. The solution to this is to use an alias record in your human-friendly domain, pointing at an hidden technical domain that the infrastructure provider keeps up-to-date (e.g. "my-elb-name-1-1160186271.ap-southeast-1.elb.amazonaws.com")

This is fine for "www.example.com" but not the naked "example.com", because aliases are prohibited at the apex.

As a result, DNS providers such as Route 53 have ended up with a hack: a spoofed record at the apex, one that tracks an external resource and synthesizes a fake A/AAAA response. Now you have a naked domain that tracks, or rather hopes to track, the correct endpoint. But it changes with the wind. Hence my description of it as "floating".

There is no consistent name for this kludge. AWS calls it an alias, and for reliability concerns restrict it to their own infrastructure only; DME call it an "ANAME" record [2]. The model can even be readily implemented as a shell script run out of cron on your nameserver. It is fragile, it is often unreliable, it is not at all standardised, and it doesn't scale beyond one service.

One better solution would be to require use of SRV records, which allow one to declare instead, for example, an "https" service for "example.com". Alongside, let's say, the xmpp service, sip service, or any other service you care to announce. SRV records can exist at the apex. They can also bundle the A and AAAA (IPv6) addresses for the resulting endpoints in the answer, and select alternative port numbers without bothering the user about it.

Not quite a universal panacea: there is a minor hazard of zone cuts that could increase the number of client lookups, but that's an edge case, not one you can easily blunder into and also easy to fix.

[1] HTTP/1.0 and earlier are forgiven, because they hail from a time when you just had a web server in a rack and called it "www". But HTTP/2 is supposed to respond to modern architectures.

[2] http://www.dnsmadeeasy.com/services/aname-records/

[3] none of you comedians are allowed to mention DNAME records as the exotic counterexample.

Re:Last Call: HTTP2 by mackwic on Friday January 02, 2015 @05:32AM (#8826321)
Thanks for your deep explanation ! That's very refreshing !

Do you have any clue why SRV is not more widely used ?

Re:Last Call: HTTP2 by nl on Friday January 02, 2015 @08:02AM (#8826600)
They are moderately popular outside of HTTP for new protocols (eg Minecraft can use them).

I suspect they aren't more popular because it requires some DNS knowledge before you think of them. It's a pity because they are very useful.

Aside: Cloudflare's free DNS hosting service supports them, with low TTL.

Re:Last Call: HTTP2 by jacquesm on Thursday January 01, 2015 @09:17PM (#8825226)
floating -> pointing to an old resource

apex record -> alias for 'A' record (DNS parlance)

So a 'floating apex record' is an A-record pointing to an old IP.

Re:Last Call: HTTP2 by 0x0 on Thursday January 01, 2015 @10:06PM (#8825331)
I think "apex record" means the root domain name in a zone, and is unrelated to A records (except for the fact that you would usually make an A record for your apex so web browsers can reach your site even without a "www." subdomain/prefix)
Re:Last Call: HTTP2 by jacquesm on Thursday January 01, 2015 @11:35PM (#8825531)
That makes sense. Thanks!
Re:Last Call: HTTP2 by meddlepal on Thursday January 01, 2015 @10:51PM (#8825422)
Have you ever considered just saying 'A record' instead of 'Apex record' so the majority of people know what you're talking about? Not all of us are DNS wonks.
Re:Last Call: HTTP2 by jacquesm on Thursday January 01, 2015 @10:52PM (#8825426)
I was just trying to figure out what the GGGP meant, that wasn't my choice of words.

I'm not a DNS wonk either.

Re:Last Call: HTTP2 by meddlepal on Thursday January 01, 2015 @11:32PM (#8825521)
Sorry about that. I see now that I responded to the wrong person.