6 ms·
How does the underscore in the hostname work? I thought that they weren't allowed[1]. Just a non-compliant DNS server + a protocol that is flexible enough to al
by pyre 14y ago
How does the underscore in the hostname work? I thought that they weren't allowed[1]. Just a non-compliant DNS server + a protocol that is flexible enough to allow it? Is it not disallowed in CNAMEs?
[1] http://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names http://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_...
- spoiler 14y agoI am guessing that *.itch.io points to some IP and that subdomains are resolved on the app level. Many services do that (my god forgotten app does, Tumblr does, I am sure others must, too)
- pyre 14y agoIt's a CNAME for itch.io, but the application doesn't resolve DNS. DNS does. If the DNS spec says that underscore isn't valid, then presumably we would never even get to the application level because the hostname wouldn't resolve to itch.io.
- reidrac 14y agoI guess it depends on how the DNS server deals with the wildcard domain. I can tell you that djbdns doesn't care about the part covered by the wildcard, it will happily resolve _!test.domain (although it is an invalid name according to the RFC).
- pyre 14y agoRead a little further, and it looks like A and MX records are required to be compliant, but other records are not, which apparently includes CNAMEs.
- nbpoole 14y agoI encountered the same problem on a site I run where I provide custom subdomains. The RFCs technically prohibit underscores but they appeared to work fine in the major browsers, with the exception of cookies in older versions of IE (ie: http://stackoverflow.com/questions/794243/internet-explorer-ignores-cookies-on-some-domains-cannot-read-or-set-cookies http://stackoverflow.com/questions/794243/internet-explorer-...). I ended up munging underscores to dashes to make everyone happy.
- tlarkworthy 14y agothe username being the subdomain was a surprise to me too. I would rather the gamename be the subdomain.
- kristaps 14y agoI had to deal with this a while ago and I found out (sorry, but I don't have a reference handy) that underscores are prohibited in the second level domain (example.com), but are ok in any further levels (šķaudiens.example.com). Basically subdomain names can be anything that your DNS server allows them to be, just as email addresses can be whatever your SMTP server will handle.
- pyre 14y agoIn my reading, it looks like 'hostnames' are required to be compliant. The best I can get for the definition of 'hostnames' is A records, and MX records. So CNAMEs are fair game.