tags:

views:

781

answers:

2

As per RFC1035, dns names may contain \ddd \x and quote symbol. Please explain with examples about those.

A: 

RFC1035 doesn't say that DNS names can contain those characters. In section 5 (MASTER FILES) it says that the file that contains the RR information can contain those characters. Specifically: "Because these files are text files several special encodings are necessary to allow arbitrary data to be loaded." There's text other than domains that can go into zone files. For instance, the entry in a TXT record is free text, so you might want to put a binary character in it, represented with a \ddd string, etc. You are also allowed to make comments, so you might use these "special encodings" in your comments.

There is support for internationalized domain names, but RFC1035 is from 1987, it wasn't talking about i18n domain names at that time.

EDIT: I just reread it and I think I'm wrong. The stuff above is technically about the file format. However, this is also in the RFC in section 3.1:

Although labels can contain any 8 bit values in octets that make up a
label, it is strongly recommended that labels follow the preferred
syntax described elsewhere in this memo, which is compatible with
existing host naming conventions.  Name servers and resolvers must
compare labels in a case-insensitive manner (i.e., A=a), assuming ASCII
with zero parity.  Non-alphabetic codes must match exactly.

So, that says that any 8-bit char can be part of a label (where a label is that part of the domain name between dots). This doc is describing the technical capability of the DNS protocol, though. Common usage is a different thing. In fact, in section "2.3.1. Preferred name syntax":

The following syntax will result in
fewer problems with many applications
that use domain names (e.g., mail,
TELNET).

<domain> ::= <subdomain> | " "

<subdomain> ::= <label> | <subdomain>
"." <label>

<label> ::= <letter> [ [ <ldh-str> ]
<let-dig> ]

<ldh-str> ::= <let-dig-hyp> |
<let-dig-hyp> <ldh-str>

<let-dig-hyp> ::= <let-dig> | "-"

<let-dig> ::= <letter> | <digit>

<letter> ::= any one of the 52
alphabetic characters A through Z in
upper case and a through z in lower
case

<digit> ::= any one of the ten digits
0 through 9

In other words, the DNS protocol was defined from the beginning to work with 8-bit ascii. However, if you actually wanted your programs to be able to use the domains in the DNS, you should stick with [a-z-].

As for an example, I think this just meant you could have a DNS entry like this:

IHaveAn\020EmbeddedTab  IN A 172.24.3.1
jj33
-1 for the mistakes: there is no such thing as "8-bits ASCII", the section on the preferred syntax is misinterpreted and the most important thing, the difference between host named and domain names is missing.
bortzmeyer
+1  A: 

The recommended reading is RFC 2181, whose section 11 explains well the issue.

Otherwise, for an example, see maps-to-nonascii.rfc-test.net. This name is an alias for a name with non-ASCII characters.

bortzmeyer