[getdns-api] Presentation format for null terminated domain name strings
Willem Toorop
willem at nlnetlabs.nl
Fri Nov 22 03:04:49 MST 2013
op 21-11-13 18:52, Paul Hoffman schreef:
> On Nov 21, 2013, at 8:56 AM, Andrew Sullivan <asullivan at dyn.com> wrote:
>
>> On Wed, Nov 20, 2013 at 06:43:58PM -0800, Paul Hoffman wrote:
>>>
>>> Can you be more specific about "master file format" and "presentation format" mean here?
>>
>> Doubtless what they always mean in a DNS context. www.example.com. is
>> in master file or presentation format (as opposed to wire, which is
>> conceptually 3www7example3com0).
>
> Not "doubtless" because there is an "or" in the original statement. And, given that that is the current format, I want to be sure we understand what is being proposed before it changes.
Sorry, the "or" was intended to mean "also known as".
But more specifically, I meant it to be like the syntax of <domain-name>
as described in section 5.1 of RFC1035.
I propose to include something like this in the specification:
The labels of the <domain-name> are expressed as character
strings separated by dots. Quoting/escaping conventions are
applied so that,
X Each character X other than the dot (.), the backslash
(\) and the null character represent themselves (X).
\X A character X other than a digit (0-9) following a
backslash represents X. For example, "\." can be used
to place a dot character in a label. A backslash
followed by a null character is no different than other
quoted characters and thus means the null character.
\DDD A backslash followed by three digits D (0-9) represents
the byte with decimal value DDD. This rule causes an
error message when there are less than three digits
following the backslash or when the value of DDD is
larger than 255.
No DHL rules as specified in [RFC0952] and relaxed in [RFC1123]
are applied.
I think it is important to make such behaviour explicit, because the
behaviour of getaddrinfo varies greatly with different systems. For
example, Linux, FreeBSD and NetBSD process quoted names, but only
actually resolve a name when all of its labels follow the LDH-rule.
SunOS and OS-X process quoted names, but do not require labels to follow
the LDH-rule. OpenBSD and MS-Windows do not process quotes and do not
require the LDH-rule.
I would prefer getdns-api to behave like SunOS and OS-X, because it is
the most permissive without the added complexity LDH-rule conformance
would introduce. Also, this is how our implementation currently operates.
More information about the getdns-api
mailing list