home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 1400s / rfc1464.txt < prev    next >
Text File  |  1993-05-23  |  8KB  |  227 lines

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