tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: getaddrinfo(3) on numerical addresses

    Date:        Tue, 24 Oct 2017 20:41:05 +0200
    From:        Edgar =?iso-8859-1?B?RnXf?= <>
    Message-ID:  <>

  | Obviously, a component can't contain a dot

It isn't obvious at all, as it can.

The syntax to allow it in text representations isn't all that clear
(or even specified - and mostly nothing is implemented at all) but the
DNS itself is a 100% binary protocol (aside from the a==A nonsense) and
has no problem at all with any of the 256 values for each byte in any label.

  | and any argument to getaddrinfo() can't contain a NULL.

not a '\0' itself in the textual form, but it could permit 'xxx\0xxx'
(literally that using shell quoting syntax, not C, in C it would be
more like "xxx\\0xxx") and convert the \ followed by 0 into a \0
byte (and similarly convert \. into an embedded '.').

That we (and just about everyone else) don't bother to do this is a
limitation of the implementation, not of the DNS.

  | Other than that, there indeed seems to be little consensus about what's
  | allowed.

No, there's actually very good consensus.

  | RFC 1035 says "start with a letter, end with a letter or digit, and have as 
  | interior characters only letters, digits, and hyphen."

If you go back and read that carefully, you'll see that is a guideline for
names (and makes them compatible with what could go in HOSTS.TXT which was
important when 1035 was written, and also avoids problems when dealing
with applications originally written when HOSTS.TXT was the lookup method.)

See RFC2181 for a more detailed explanation of this issue (and others.)

  | which seems to be what 
  | BIND enforces since 4.9.4 (unless you fiddle with check-names).

What bind enforces for the local zone - which is fine.   Local admins
can subject their domain to whatever naming rules they like, in fact,
check names is really too inflexible, for example, an admin might want
to prohibit what (s)he regards as inappropriate names, like scheisse or
merde, and configure check-names to reject those as well (except the
implementation doesn't go that far).    Their domain, their choice.

When first introduced, bind defaulted check-names on for all uses.
Vixie and I had "words" about that, and bind was changed to only
have it default on for primary zones.

  | KRE> But who knows what ICANN will create next week?
  | I guess as soon as they invent numerical TLDs, it's time to start ignoring 
  | them.

Unfortunately we don't get that choice.   It isn't likely that it will
ever happen, but we do not write code to deal with "I hope it continues
like ..." - we assume the worst, and perhaps optimise for the more likely


Home | Main Index | Thread Index | Old Index