4 ms·
Here is a question I hoped to be answered, but it wasn’t: Why doesn’t the HTTP/2 protocol use SRV DNS records¹? Using it would solve some real problems: 1. Th
by teddyh 12y ago
Here is a question I hoped to be answered, but it wasn’t: Why doesn’t the HTTP/2 protocol use SRV DNS records¹? Using it would solve some real problems:
1. The well-known resilience of mail can be largely attributed to its use of MX records to specify the use of backup servers and/or load balancing. SRV records are essentially a generalization of MX records for any service, not just mail, so using SRV records would bring this benefit to any protocol which uses them.
2. The problem of “www” or no “www” would be entirely eliminated; no need for non-standard so-called ANAME or ALIAS “records”. Just imagine – if, in an alternate universe, mail servers hadn’t used MX records, it would then have been necessary to have an A record on the bare domain name, and later, when the Web was created in this alternate universe, the web server would have to be the same server as the mail server, since both now would use the bare domain name. In our universe, this position is now solely occupied by the HTTP protocol, which causes lots of pain in the DNS when redundant (and harder to update) A records need to be put on the bare domain name just for HTTP. Not to mention IPv6, which, for HTTP to work, requires an additional AAAA record on the bare domain.
3. The “everything is on port 80, let’s reinvent everything on top of HTTP” problem could certainly have been entirely avoided, and could be slowly fixed, by using SRV records. (A server concerned about clients needing to traverse old-style restrictive firewalls could provide a low-priority port 80 server as a fallback.)
① A DNS RR for specifying the location of services (DNS SRV) https://tools.ietf.org/html/rfc2782 https://tools.ietf.org/html/rfc2782
- Lukasa 12y ago> Why doesn't the HTTP/2 protocol use SRV DNS records? This was discussed by the WG. The best rationale is given in the thread starting from this mail[0] from Will Chan at Google, followed up by this one[1] from Amos Jeffries (Squid Proxy). The summary is: waiting for SRV lookups can be slower than just doing straight-up A records, so no client in a competitive space is going to do it. Everyone agrees that in an ideal world this would be great, but in practice no-one is going to be the first person to move on that front. The wins aren't big enough and the cost is too high. [0]: http://lists.w3.org/Archives/Public/ietf-http-wg/2014JanMar/0788.html http://lists.w3.org/Archives/Public/ietf-http-wg/2014JanMar/... [1]: http://lists.w3.org/Archives/Public/ietf-http-wg/2014JanMar/0797.html http://lists.w3.org/Archives/Public/ietf-http-wg/2014JanMar/...
- nl 12y agoInteresting. Reading that I'm not sure the problem is that SRV lookups are slower, but that forcing clients to do a SRV lookup, wait, and then a A/AAAA queries is slower: If I own a popular client and I switch to mandatory SRV lookup, and don't issue A and AAAA queries until the SRV lookup fails, then for the services and paths where SRV lookup doesn't work, user experience will be vastly degraded.[1] However,it appears that making SRV optional remains a possibility: Note that none of what I've said necessarily applies to optionally doing SRV and using it when the results are available. [1] http://lists.w3.org/Archives/Public/ietf-http-wg/2014JanMar/0788.html http://lists.w3.org/Archives/Public/ietf-http-wg/2014JanMar/...
- Lukasa 12y agoCorrect, but you don't need the RFC to make SRV optional. If you'd like to use it, use it.
- teddyh 12y agoNo, on the contrary, the SRV standard specifies that clients SHOULD NOT use SRV records for protocols for which the standards do not explicitly allow for SRV records.
- belorn 12y agoMulti-request resolving (QDCOUNT > 1) would solve that problem, which is a lesser known feature of the DNS protocol. Clients could ask for all A, AAAA, and SRV for a given domain, and get all the replies in a single round-trip. Few if any resolvers support this feature, but it show that the problem we have is because of legacy assumption that are no longer true. Fix those, and the problem goes away. : https://www.ietf.org/rfc/rfc1035.txt https://www.ietf.org/rfc/rfc1035.txt
- teddyh 12y agoThe key words in your quote is “for the services and paths where SRV lookup doesn't work”. You get the same problem today where A lookup doesn’t work. This is an abnormal situation. As I wrote in another comment, normally you get an answer immediately (possibly an empty one where no SRV record exists). I don’t know why a situation with no reply should be considered common enough to optimize for. (Clients which really wanted to mitigate this could certainly detect this case when it happens and keep a blacklist.)
- nl 12y agoI've recently done some work using SRV (for Minecraft, which uses it). I agree it's a pretty decent system, and something I'd like to see more systems adopt it. Interestingly, I can't actually think of a reason why a (customised) web browser couldn't use it now. If a browser understood SRV records it could use the correct port. There might be some odd interactions with the HTTP 1.1 Host header, but I haven't thought about it much. Of course, browsers that don't understand it wouldn't be able to follow links that use it which is something of a downside I guess.
- teddyh 12y agoAccording to the RFC for SRV records, applications SHOULD NOT use SRV records unless explicitly allowed in the standard/RFC for that protocol. There is no mention of SRV records in either the old HTTP RFC or the new HTTP/2 draft RFC; therefore, clients are not permitted to use SRV records. (I wrote about this previously here on HN: https://news.ycombinator.com/item?id=7522208 https://news.ycombinator.com/item?id=7522208)
- nl 12y agoSHOULD NOT prohibits nothing. Indeed, since the HTTP/1.1 RFC was issued in 1999 and the SRV RFC in 2000 there is no way it could have mentioned it. If there are technical reasons why it can't work that's one thing. If some verbiage in the RFC is all that holds it back it's easy to fix: try it out, then issue a new RFC. The whole RFC process embraces changes like this.
- teddyh 12y ago> SHOULD NOT prohibits nothing. And an RFC is not a standard, and all life is meaningless? No, a SHOULD NOT should be taken seriously, not ignored. The SRV RFC included that language for a reason, and probably had HTTP in mind when they wrote it, and therefore wanted HTTP clients not to use SRV records randomly. Since then, HTTP has has plenty of time to add SRV usage in its minor revisions, but has chosen not to. But now, with HTTP/2, a major revision, it is the perfect time to add this kind of thing.
- drdaeman 12y agoWe have a tradition of introducing hacks over kludges. Don't break it.