RFC 1464

Using the Domain Name System To Store Arbitrary String Attributes

๐Ÿ“… published May 1993, from ietf

RFC 1464: Using the Domain Name System To Store Arbitrary String Attributes ๐Ÿฆ‹

okay bestie, this is RFC 1464 ๐ŸŽ€ from May 1993. It came out of the Network Working Group and was written by R. Rosenbaum (signing off as Rich Rosenbaum in the address section) at Digital Equipment Corporation ๐Ÿ’ผ. The category is an Experimental Protocol ๐Ÿงช, so it's a "try it and tell us" kinda vibe. The header doesn't list anything it obsoletes or updates, so no drama there ๐Ÿ™ˆ.


Status of this Memo โœจ

This memo defines an Experimental Protocol for the Internet community ๐Ÿงช. They're literally asking for discussion and suggestions for improvement, so speak up! For the standardization state and status of this protocol, check the current edition of the "IAB Official Protocol Standards" ๐Ÿ“œ. Distribution of this memo is unlimited ๐ŸŒˆ.

Abstract ๐Ÿ’œ

okay so the Domain Name System (DNS) [2,3] is mostly used to store predefined stuff, like addresses of hosts ๐Ÿ . but it's totally possible to use it for info nobody has classified yet ๐Ÿ‘€. this paper describes a simple way to attach arbitrary string info (ASCII text) to attributes the DNS hasn't defined. it uses DNS TXT resource records to store the info, and it needs zero changes to current DNS implementations ๐Ÿ’….


1. Introduction โœจ

the Domain Name System is built to hold stuff with a predefined type and structure, like IP addresses of hosts and names of mail exchangers ๐Ÿ“ฌ. it would be super useful to tap into the DNS's widespread use and scaleability to store info that hasn't been defined before ๐ŸŒธ.

this paper proposes using the DNS TXT resource record (defined in STD 13, RFC 1035) to hold new types of info ๐ŸŽ€. the main perk is that it needs no change to most existing DNS servers ๐Ÿ™Œ. it is not trying to replace the process for defining and implementing new resource records ๐Ÿซถ.

2. Format of TXT record ๐Ÿ’–

okay so the TXT record uses a structured format in its TXT-DATA field ๐Ÿง . it's the attribute name, then the value of the attribute, and the two are split by an equals sign (=) โœ‚๏ธ.

here are some TXT records using attributes like that ๐Ÿ‘‡

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 allowed in the attribute name ๐Ÿ”ค. if an equals sign is embedded in the attribute name, it MUST be quoted with a preceding grave accent (or backquote: `) ๐Ÿ™…. and a backquote MUST also be quoted with an additional ` ๐Ÿ’….

Attribute Name Matching Rules

the attribute name is case-insensitive ๐ŸŒˆ. so a lookup for "Favorite Drink" would match a TXT record containing "favorite drink=Earl Grey tea" ๐Ÿซ–.

during lookups, TXT records without an unquoted "=" get ignored ๐Ÿ™ˆ. TXT records that seem to have a null attribute name (so the TXT-DATA starts with the character "=") also get ignored ๐Ÿšซ.

leading and trailing whitespace (spaces and tabs) in the attribute name gets ignored unless it's quoted (with a `) โœจ. for example, "abc" matches " abc<tab>" but does not match "` abc" ๐Ÿ’….

heads up though: most DNS server implementations want a backslash (\) or double quote (") in a text string quoted with a preceding backslash ๐Ÿ™ƒ. that's why accent grave (`) got picked as the quoting character here: to avoid confusion with \ and skip the need for messy strings like \\\\ ๐Ÿงน.

Attribute Values

all printable ASCII characters are allowed in the attribute value ๐ŸŽจ. no characters need quoting with a ` ๐Ÿ™Œ. so the first unquoted equals sign in the TXT record is the name/value delimiter, and everything after it is part of the value ๐Ÿ’œ.

once again, in most implementations the backslash is an active quoting character (and MUST, itself, be quoted) ๐Ÿ”.

all whitespace in the attribute value gets returned to the requestor, and it's up to the application to decide if it matters ๐Ÿคท.

Examples

<sp> means 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 "

3. Application Usage ๐Ÿ› ๏ธ

the attributes can be reached through the standard resolver library, but it is RECOMMENDED that you use a library routine built specially for this attribute format ๐Ÿ“š. that routine might give you something like gethostbyname:

getattributebyname(objectname,          name of object
                   attributename,       name of attribute
                   attributevalue,      pointer to buffer
                   attributevaluelen)   length of buffer

this routine would strip out all the quoting characters before handing the info back to the caller ๐Ÿงน. a fancier routine could return attributes with multiple values, or several different attributes at once ๐ŸŽ.

4. Attribute Name Registration ๐Ÿ“

to make interop easier and cut down on naming conflicts, a registration process for well-known attribute names might get set up ๐Ÿค. it could be a periodically updated list of names, and/or follow other name registration mechanisms, like published object identifiers ๐Ÿ—‚๏ธ. this paper does not cover attribute name registration ๐Ÿ™….

5. Restrictions ๐Ÿšง

some DNS server implementations put limits on the size or number of TXT records tied to a particular owner ๐Ÿ“. certain implementations MAY not support TXT records at all ๐Ÿ™ˆ.


6. REFERENCES and BIBLIOGRAPHY ๐Ÿ“š

here are all the citations, bestie ๐Ÿซถ:

  • [1] Stahl, M., "Domain Administrators Guide", RFC 1032, Network Information Center, SRI International, November 1987.
  • [2] Mockapetris, P., "Domain Names - Concepts and Facilities", STD 13, RFC 1034, USC/Information Sciences Institute, November 1987.
  • [3] Mockapetris, P., "Domain Names - Implementation and Specification", STD 13, RFC 1035, USC/Information Sciences Institute, November 1987.
  • [4] Mockapetris, P., "DNS Encoding of Network Names and Other Types", RFC 1101, USC/Information Sciences Institute, April 1989.

7. Security Considerations ๐Ÿ”

security issues are not discussed in this memo ๐Ÿ’€. bestie, that's the whole section, so don't go assuming it covers anything it doesn't. this one is serious business ๐Ÿ˜ญ.

8. Author's Address ๐Ÿ“ฎ

Rich Rosenbaum
Digital Equipment Corporation
550 King Street, LKG2-2/Z7
Littleton, MA  01460-1289

Phone: 508-486-5922
Email: rosenbaum@lkg.dec.com
๐Ÿ“ฆ where this page comes from