Re: Bug#575209: closed by Holger Levsen <firstname.lastname@example.org> (Re: Bug#575209: general: Error resolving hostname [resent])
Fabian Greffrath <email@example.com> writes:
> - Sites with domain names like <ker-.deviantart.com> do already exist!
> Do you think they should be accessible by any other proprietary
> operating system, but not Debian? Not really!
Anyone can enter bogus data in the DNS. Neither the existence of such
data nor the failure to detect it by other operating systems are
arguments for allowing it in Debian. Literally anyone can add an
invalid A record and make an OS which accepts it.
> - There is already an inconsistency among the different
> implementations in Debian (or Linux as a whole), as e.g. ping and any
> other program using gethostbyname() fail to resolv, whereas nslookup
> and host succeed.
This is not an inconsistency.
gethostbyname(), getaddrinfo() etc look up hostnames, whereas dig,
nslookup and host query the DNS. The distinction is that almost
anything is allowed in DNS, while a hostname must obey the updated
version of RFC 952 (as amended by RFC 1123). See e.g.
http://firstname.lastname@example.org/msg01731.html for an
excellent explanation of the difference.
> - The advice in the cited RFC is already ignored. Domain names that
> start with a digit, e.g. 12345.foo.bar, can be resolved, whereas the
> RFC tells us "They [labels] must start with a letter, end with a
> letter or digit [...]". So let's just relax the rules in the RFC (they
> are only recommendations after all) a bit more to also allow hyphens
> as border characters in labels. It doesn't harm anyone, it just
> enables us to resolv a few more actual domain names!
This rule has been formally changed by the standards track RFC 1123.
That is something quite different than "the cited RFC is already
> the advice of RFC 1035
which is the standards track RFC describing the *domain name system*
which is so much more than host names. It is irrelevant wrt the
discussion of valid hostnames.
Unfortunately this RFC is one of the most confusing ever written, mixing
a lot of irrelevant informational data with the actual standard. It
should have merely referred to RFC 822 (updated several times) and RFC
952 (amended several times) for the restrictions on valid mail and host
names. The verbose examples copying restrictions imposed by other
standards have always been confusing, and of course even more so after
the other standards were changed...
> RFC 1178:
which is an informational RFC.
> RFC 952:
which is the standards RFC describing valid hostnames. This should be
obeyed, as amended by other RFCs.
> RFC 1123:
which is a standards track RFC updating and clarifying lots of other
standards. Among the changes is the modification of RFC 952 wrt labels
starting with a digit.
You forgot to mention RFC 2181 which is a standards track RFC trying to
fix a few of the errors in RFC 1035, among those the mixture of standard
requirements and informational text. Although as irrelevant to this
discussion as RFC 1035 itself, I believe it helps understand the
distinction between valid DNS labels and valid host or mail names.