1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
|
<pre>Network Working Group R. Rosenbaum
Request for Comments: 1464 Digital Equipment Corporation
May 1993
<span class="h1">Using the Domain Name System</span>
<span class="h1">To Store Arbitrary String Attributes</span>
Status of this Memo
This memo defines an Experimental Protocol for the Internet
community. Discussion and suggestions for improvement are requested.
Please refer to the current edition of the "IAB Official Protocol
Standards" for the standardization state and status of this protocol.
Distribution of this memo is unlimited.
Abstract
While the Domain Name System (DNS) [<a href="#ref-2" title=""Domain Names - Concepts and Facilities"">2</a>,<a href="#ref-3" title=""Domain Names - Implementation and Specification"">3</a>] is generally used to store
predefined types of information (e.g., addresses of hosts), it is
possible to use it to store information that has not been previously
classified.
This paper describes a simple means to associate arbitrary string
information (ASCII text) with attributes that have not been defined
by the DNS. It uses DNS TXT resource records to store the
information. It requires no change to current DNS implementations.
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
The Domain Name System is designed to store information that has both
a predefined type and structure. Examples include IP addresses of
hosts and names of mail exchangers. It would be useful to take
advantage of the widespread use and scaleability of the DNS to store
information that has not been previously defined.
This paper proposes the use of the DNS TXT resource record (defined
in STD 13, <a href="./rfc1035">RFC 1035</a>) to contain new types of information. The
principal advantage of such an approach is that it requires no change
to most existing DNS servers. It is not intended to replace the
process by which new resource records are defined and implemented.
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Format of TXT record</span>
To store new types of information, the TXT record uses a structured
format in its TXT-DATA field. The format consists of the attribute
name followed by the value of the attribute. The name and value are
separated by an equals sign (=).
<span class="grey">Rosenbaum [Page 1]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
<span class="grey"><a href="./rfc1464">RFC 1464</a> Storing Arbitrary Attributes in DNS May 1993</span>
For example, the following TXT records contain attributes specified
in this fashion:
host.widgets.com IN TXT "printer=lpr5"
sam.widgets.com IN TXT "favorite drink=orange juice"
The general syntax is:
<owner> <class> <ttl> TXT "<attribute name>=<attribute value>"
Attribute Names
Any printable ASCII character is permitted for the attribute name.
If an equals sign is embedded in the attribute name, it must be
quoted with a preceding grave accent (or backquote: "`"). A
backquote must also be quoted with an additional "`".
Attribute Name Matching Rules
The attribute name is considered case-insensitive. For example, a
lookup of the attribute "Favorite Drink" would match a TXT record
containing "favorite drink=Earl Grey tea".
During lookups, TXT records that do not contain an unquoted "=" are
ignored. TXT records that seem to contain a null attribute name,
that is, the TXT-DATA starts with the character "=", are also
ignored.
Leading and trailing whitespace (spaces and tabs) in the attribute
name are ignored unless they are quoted (with a "`"). For example,
"abc" matches " abc<tab>" but does not match "` abc".
Note that most DNS server implementations require a backslash (\) or
double quote (") in a text string to be quoted with a preceding
backslash. Accent grave ("`") was chosen as a quoting character in
this syntax to avoid confusion with "\" (and remove the need for
confusing strings that include sequences like "\\\\").
Attribute Values
All printable ASCII characters are permitted in the attribute value.
No characters need to be quoted with a "`". In other words, the
first unquoted equals sign in the TXT record is the name/value
delimiter. All subsequent characters are part of the value.
Once again, note that in most implementations the backslash character
is an active quoting character (and must, itself, be quoted).
<span class="grey">Rosenbaum [Page 2]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
<span class="grey"><a href="./rfc1464">RFC 1464</a> Storing Arbitrary Attributes in DNS May 1993</span>
All whitespace in the attribute value is returned to the requestor
(it is up to the application to decide if it is significant.)
Examples
<sp> indicates a space character.
Attribute Attribute Internal Form External Form
Name Value (server to resolver) (TXT record)
color blue color=blue "color=blue"
equation a=4 equation=a=4 "equation=a=4"
a=a true a`=a=true "a`=a=true"
a\=a false a\`=a=false "a\\`=a=false"
= \= `==\= "`==\\="
string "Cat" string="Cat" "string=\"Cat\""
string2 `abc` string2=``abc`` "string2=``abc``"
novalue novalue= "novalue="
a b c d a b=c d "a b=c d"
abc<sp> 123<sp> abc` =123<sp> "abc` =123 "
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. Application Usage</span>
The attributes can be accessed by the standard resolver library, but
it is recommended that a library routine designed specially for this
attribute format be used. Such a routine might provide an analogue
to gethostbyname:
getattributebyname(objectname, name of object
attributename, name of attribute
attributevalue, pointer to buffer
attributevaluelen) length of buffer
This routine would remove all quoting characters before returning the
information to the caller. A more complex routine could return
attributes with multiple values, or several different attributes.
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. Attribute Name Registration</span>
To permit ease of interoperability and to reduce the chance of naming
conflicts, a registration process for well known attribute names
might be established. This could be a periodically updated list of
names and/or adherence to other name registration mechanisms such as
published object identifiers.
This paper does not address attribute name registration.
<span class="grey">Rosenbaum [Page 3]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
<span class="grey"><a href="./rfc1464">RFC 1464</a> Storing Arbitrary Attributes in DNS May 1993</span>
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. Restrictions</span>
Some DNS server implementations place limits on the size or number of
TXT records associated with a particular owner. Certain
implementations may not support TXT records at all.
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. REFERENCES and BIBLIOGRAPHY</span>
[<a id="ref-1">1</a>] Stahl, M., "Domain Administrators Guide", <a href="./rfc1032">RFC 1032</a>, Network
Information Center, SRI International, November 1987.
[<a id="ref-2">2</a>] Mockapetris, P., "Domain Names - Concepts and Facilities", STD
13, <a href="./rfc1034">RFC 1034</a>, USC/Information Sciences Institute, November 1987.
[<a id="ref-3">3</a>] Mockapetris, P., "Domain Names - Implementation and
Specification", STD 13, <a href="./rfc1035">RFC 1035</a>, USC/Information Sciences
Institute, November 1987.
[<a id="ref-4">4</a>] Mockapetris, P., "DNS Encoding of Network Names and Other Types",
<a href="./rfc1101">RFC 1101</a>, USC/Information Sciences Institute, April 1989.
<span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. Security Considerations</span>
Security issues are not discussed in this memo.
<span class="h2"><a class="selflink" id="section-8" href="#section-8">8</a>. Author's Address</span>
Rich Rosenbaum
Digital Equipment Corporation
550 King Street, LKG2-2/Z7
Littleton, MA 01460-1289
Phone: 508-486-5922
Email: rosenbaum@lkg.dec.com
Rosenbaum [Page 4]
</pre>
|