1 2 3 4 5 6 7 Network Working Group P. Faltstrom 8 Request for Comments: 3490 Cisco 9 Category: Standards Track P. Hoffman 10 IMC & VPNC 11 A. Costello 12 UC Berkeley 13 March 2003 14 15 16 Internationalizing Domain Names in Applications (IDNA) 17 18 Status of this Memo 19 20 This document specifies an Internet standards track protocol for the 21 Internet community, and requests discussion and suggestions for 22 improvements. Please refer to the current edition of the "Internet 23 Official Protocol Standards" (STD 1) for the standardization state 24 and status of this protocol. Distribution of this memo is unlimited. 25 26 Copyright Notice 27 28 Copyright (C) The Internet Society (2003). All Rights Reserved. 29 30 Abstract 31 32 Until now, there has been no standard method for domain names to use 33 characters outside the ASCII repertoire. This document defines 34 internationalized domain names (IDNs) and a mechanism called 35 Internationalizing Domain Names in Applications (IDNA) for handling 36 them in a standard fashion. IDNs use characters drawn from a large 37 repertoire (Unicode), but IDNA allows the non-ASCII characters to be 38 represented using only the ASCII characters already allowed in so- 39 called host names today. This backward-compatible representation is 40 required in existing protocols like DNS, so that IDNs can be 41 introduced with no changes to the existing infrastructure. IDNA is 42 only meant for processing domain names, not free text. 43 44 Table of Contents 45 46 1. Introduction.................................................. 2 47 1.1 Problem Statement......................................... 3 48 1.2 Limitations of IDNA....................................... 3 49 1.3 Brief overview for application developers................. 4 50 2. Terminology................................................... 5 51 3. Requirements and applicability................................ 7 52 3.1 Requirements.............................................. 7 53 3.2 Applicability............................................. 8 54 3.2.1. DNS resource records................................ 8 55 56 57 58 Faltstrom, et al. Standards Track [Page 1] 59 61 RFC 3490 IDNA March 2003 62 63 64 3.2.2. Non-domain-name data types stored in domain names... 9 65 4. Conversion operations......................................... 9 66 4.1 ToASCII................................................... 10 67 4.2 ToUnicode................................................. 11 68 5. ACE prefix.................................................... 12 69 6. Implications for typical applications using DNS............... 13 70 6.1 Entry and display in applications......................... 14 71 6.2 Applications and resolver libraries....................... 15 72 6.3 DNS servers............................................... 15 73 6.4 Avoiding exposing users to the raw ACE encoding........... 16 74 6.5 DNSSEC authentication of IDN domain names................ 16 75 7. Name server considerations.................................... 17 76 8. Root server considerations.................................... 17 77 9. References.................................................... 18 78 9.1 Normative References...................................... 18 79 9.2 Informative References.................................... 18 80 10. Security Considerations...................................... 19 81 11. IANA Considerations.......................................... 20 82 12. Authors' Addresses........................................... 21 83 13. Full Copyright Statement..................................... 22 84 85 1. Introduction 86 87 IDNA works by allowing applications to use certain ASCII name labels 88 (beginning with a special prefix) to represent non-ASCII name labels. 89 Lower-layer protocols need not be aware of this; therefore IDNA does 90 not depend on changes to any infrastructure. In particular, IDNA 91 does not depend on any changes to DNS servers, resolvers, or protocol 92 elements, because the ASCII name service provided by the existing DNS 93 is entirely sufficient for IDNA. 94 95 This document does not require any applications to conform to IDNA, 96 but applications can elect to use IDNA in order to support IDN while 97 maintaining interoperability with existing infrastructure. If an 98 application wants to use non-ASCII characters in domain names, IDNA 99 is the only currently-defined option. Adding IDNA support to an 100 existing application entails changes to the application only, and 101 leaves room for flexibility in the user interface. 102 103 A great deal of the discussion of IDN solutions has focused on 104 transition issues and how IDN will work in a world where not all of 105 the components have been updated. Proposals that were not chosen by 106 the IDN Working Group would depend on user applications, resolvers, 107 and DNS servers being updated in order for a user to use an 108 internationalized domain name. Rather than rely on widespread 109 updating of all components, IDNA depends on updates to user 110 applications only; no changes are needed to the DNS protocol or any 111 DNS servers or the resolvers on user's computers. 112 113 114 115 Faltstrom, et al. Standards Track [Page 2] 116 118 RFC 3490 IDNA March 2003 119 120 121 1.1 Problem Statement 122 123 The IDNA specification solves the problem of extending the repertoire 124 of characters that can be used in domain names to include the Unicode 125 repertoire (with some restrictions). 126 127 IDNA does not extend the service offered by DNS to the applications. 128 Instead, the applications (and, by implication, the users) continue 129 to see an exact-match lookup service. Either there is a single 130 exactly-matching name or there is no match. This model has served 131 the existing applications well, but it requires, with or without 132 internationalized domain names, that users know the exact spelling of 133 the domain names that the users type into applications such as web 134 browsers and mail user agents. The introduction of the larger 135 repertoire of characters potentially makes the set of misspellings 136 larger, especially given that in some cases the same appearance, for 137 example on a business card, might visually match several Unicode code 138 points or several sequences of code points. 139 140 IDNA allows the graceful introduction of IDNs not only by avoiding 141 upgrades to existing infrastructure (such as DNS servers and mail 142 transport agents), but also by allowing some rudimentary use of IDNs 143 in applications by using the ASCII representation of the non-ASCII 144 name labels. While such names are very user-unfriendly to read and 145 type, and hence are not suitable for user input, they allow (for 146 instance) replying to email and clicking on URLs even though the 147 domain name displayed is incomprehensible to the user. In order to 148 allow user-friendly input and output of the IDNs, the applications 149 need to be modified to conform to this specification. 150 151 IDNA uses the Unicode character repertoire, which avoids the 152 significant delays that would be inherent in waiting for a different 153 and specific character set be defined for IDN purposes by some other 154 standards developing organization. 155 156 1.2 Limitations of IDNA 157 158 The IDNA protocol does not solve all linguistic issues with users 159 inputting names in different scripts. Many important language-based 160 and script-based mappings are not covered in IDNA and need to be 161 handled outside the protocol. For example, names that are entered in 162 a mix of traditional and simplified Chinese characters will not be 163 mapped to a single canonical name. Another example is Scandinavian 164 names that are entered with U+00F6 (LATIN SMALL LETTER O WITH 165 DIAERESIS) will not be mapped to U+00F8 (LATIN SMALL LETTER O WITH 166 STROKE). 167 168 169 170 171 172 Faltstrom, et al. Standards Track [Page 3] 173 175 RFC 3490 IDNA March 2003 176 177 178 An example of an important issue that is not considered in detail in 179 IDNA is how to provide a high probability that a user who is entering 180 a domain name based on visual information (such as from a business 181 card or billboard) or aural information (such as from a telephone or 182 radio) would correctly enter the IDN. Similar issues exist for ASCII 183 domain names, for example the possible visual confusion between the 184 letter 'O' and the digit zero, but the introduction of the larger 185 repertoire of characters creates more opportunities of similar 186 looking and similar sounding names. Note that this is a complex 187 issue relating to languages, input methods on computers, and so on. 188 Furthermore, the kind of matching and searching necessary for a high 189 probability of success would not fit the role of the DNS and its 190 exact matching function. 191 192 1.3 Brief overview for application developers 193 194 Applications can use IDNA to support internationalized domain names 195 anywhere that ASCII domain names are already supported, including DNS 196 master files and resolver interfaces. (Applications can also define 197 protocols and interfaces that support IDNs directly using non-ASCII 198 representations. IDNA does not prescribe any particular 199 representation for new protocols, but it still defines which names 200 are valid and how they are compared.) 201 202 The IDNA protocol is contained completely within applications. It is 203 not a client-server or peer-to-peer protocol: everything is done 204 inside the application itself. When used with a DNS resolver 205 library, IDNA is inserted as a "shim" between the application and the 206 resolver library. When used for writing names into a DNS zone, IDNA 207 is used just before the name is committed to the zone. 208 209 There are two operations described in section 4 of this document: 210 211 - The ToASCII operation is used before sending an IDN to something 212 that expects ASCII names (such as a resolver) or writing an IDN 213 into a place that expects ASCII names (such as a DNS master file). 214 215 - The ToUnicode operation is used when displaying names to users, 216 for example names obtained from a DNS zone. 217 218 It is important to note that the ToASCII operation can fail. If it 219 fails when processing a domain name, that domain name cannot be used 220 as an internationalized domain name and the application has to have 221 some method of dealing with this failure. 222 223 IDNA requires that implementations process input strings with 224 Nameprep [NAMEPREP], which is a profile of Stringprep [STRINGPREP], 225 and then with Punycode [PUNYCODE]. Implementations of IDNA MUST 226 227 228 229 Faltstrom, et al. Standards Track [Page 4] 230 232 RFC 3490 IDNA March 2003 233 234 235 fully implement Nameprep and Punycode; neither Nameprep nor Punycode 236 are optional. 237 238 2. Terminology 239 240 The key words "MUST", "SHALL", "REQUIRED", "SHOULD", "RECOMMENDED", 241 and "MAY" in this document are to be interpreted as described in BCP 242 14, RFC 2119 [RFC2119]. 243 244 A code point is an integer value associated with a character in a 245 coded character set. 246 247 Unicode [UNICODE] is a coded character set containing tens of 248 thousands of characters. A single Unicode code point is denoted by 249 "U+" followed by four to six hexadecimal digits, while a range of 250 Unicode code points is denoted by two hexadecimal numbers separated 251 by "..", with no prefixes. 252 253 ASCII means US-ASCII [USASCII], a coded character set containing 128 254 characters associated with code points in the range 0..7F. Unicode 255 is an extension of ASCII: it includes all the ASCII characters and 256 associates them with the same code points. 257 258 The term "LDH code points" is defined in this document to mean the 259 code points associated with ASCII letters, digits, and the hyphen- 260 minus; that is, U+002D, 30..39, 41..5A, and 61..7A. "LDH" is an 261 abbreviation for "letters, digits, hyphen". 262 263 [STD13] talks about "domain names" and "host names", but many people 264 use the terms interchangeably. Further, because [STD13] was not 265 terribly clear, many people who are sure they know the exact 266 definitions of each of these terms disagree on the definitions. In 267 this document the term "domain name" is used in general. This 268 document explicitly cites [STD3] whenever referring to the host name 269 syntax restrictions defined therein. 270 271 A label is an individual part of a domain name. Labels are usually 272 shown separated by dots; for example, the domain name 273 "www.example.com" is composed of three labels: "www", "example", and 274 "com". (The zero-length root label described in [STD13], which can 275 be explicit as in "www.example.com." or implicit as in 276 "www.example.com", is not considered a label in this specification.) 277 IDNA extends the set of usable characters in labels that are text. 278 For the rest of this document, the term "label" is shorthand for 279 "text label", and "every label" means "every text label". 280 281 282 283 284 285 286 Faltstrom, et al. Standards Track [Page 5] 287 289 RFC 3490 IDNA March 2003 290 291 292 An "internationalized label" is a label to which the ToASCII 293 operation (see section 4) can be applied without failing (with the 294 UseSTD3ASCIIRules flag unset). This implies that every ASCII label 295 that satisfies the [STD13] length restriction is an internationalized 296 label. Therefore the term "internationalized label" is a 297 generalization, embracing both old ASCII labels and new non-ASCII 298 labels. Although most Unicode characters can appear in 299 internationalized labels, ToASCII will fail for some input strings, 300 and such strings are not valid internationalized labels. 301 302 An "internationalized domain name" (IDN) is a domain name in which 303 every label is an internationalized label. This implies that every 304 ASCII domain name is an IDN (which implies that it is possible for a 305 name to be an IDN without it containing any non-ASCII characters). 306 This document does not attempt to define an "internationalized host 307 name". Just as has been the case with ASCII names, some DNS zone 308 administrators may impose restrictions, beyond those imposed by DNS 309 or IDNA, on the characters or strings that may be registered as 310 labels in their zones. Such restrictions have no impact on the 311 syntax or semantics of DNS protocol messages; a query for a name that 312 matches no records will yield the same response regardless of the 313 reason why it is not in the zone. Clients issuing queries or 314 interpreting responses cannot be assumed to have any knowledge of 315 zone-specific restrictions or conventions. 316 317 In IDNA, equivalence of labels is defined in terms of the ToASCII 318 operation, which constructs an ASCII form for a given label, whether 319 or not the label was already an ASCII label. Labels are defined to 320 be equivalent if and only if their ASCII forms produced by ToASCII 321 match using a case-insensitive ASCII comparison. ASCII labels 322 already have a notion of equivalence: upper case and lower case are 323 considered equivalent. The IDNA notion of equivalence is an 324 extension of that older notion. Equivalent labels in IDNA are 325 treated as alternate forms of the same label, just as "foo" and "Foo" 326 are treated as alternate forms of the same label. 327 328 To allow internationalized labels to be handled by existing 329 applications, IDNA uses an "ACE label" (ACE stands for ASCII 330 Compatible Encoding). An ACE label is an internationalized label 331 that can be rendered in ASCII and is equivalent to an 332 internationalized label that cannot be rendered in ASCII. Given any 333 internationalized label that cannot be rendered in ASCII, the ToASCII 334 operation will convert it to an equivalent ACE label (whereas an 335 ASCII label will be left unaltered by ToASCII). ACE labels are 336 unsuitable for display to users. The ToUnicode operation will 337 convert any label to an equivalent non-ACE label. In fact, an ACE 338 label is formally defined to be any label that the ToUnicode 339 operation would alter (whereas non-ACE labels are left unaltered by 340 341 342 343 Faltstrom, et al. Standards Track [Page 6] 344 346 RFC 3490 IDNA March 2003 347 348 349 ToUnicode). Every ACE label begins with the ACE prefix specified in 350 section 5. The ToASCII and ToUnicode operations are specified in 351 section 4. 352 353 The "ACE prefix" is defined in this document to be a string of ASCII 354 characters that appears at the beginning of every ACE label. It is 355 specified in section 5. 356 357 A "domain name slot" is defined in this document to be a protocol 358 element or a function argument or a return value (and so on) 359 explicitly designated for carrying a domain name. Examples of domain 360 name slots include: the QNAME field of a DNS query; the name argument 361 of the gethostbyname() library function; the part of an email address 362 following the at-sign (@) in the From: field of an email message 363 header; and the host portion of the URI in the src attribute of an 364 HTML <IMG> tag. General text that just happens to contain a domain 365 name is not a domain name slot; for example, a domain name appearing 366 in the plain text body of an email message is not occupying a domain 367 name slot. 368 369 An "IDN-aware domain name slot" is defined in this document to be a 370 domain name slot explicitly designated for carrying an 371 internationalized domain name as defined in this document. The 372 designation may be static (for example, in the specification of the 373 protocol or interface) or dynamic (for example, as a result of 374 negotiation in an interactive session). 375 376 An "IDN-unaware domain name slot" is defined in this document to be 377 any domain name slot that is not an IDN-aware domain name slot. 378 Obviously, this includes any domain name slot whose specification 379 predates IDNA. 380 381 3. Requirements and applicability 382 383 3.1 Requirements 384 385 IDNA conformance means adherence to the following four requirements: 386 387 1) Whenever dots are used as label separators, the following 388 characters MUST be recognized as dots: U+002E (full stop), U+3002 389 (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61 390 (halfwidth ideographic full stop). 391 392 2) Whenever a domain name is put into an IDN-unaware domain name slot 393 (see section 2), it MUST contain only ASCII characters. Given an 394 internationalized domain name (IDN), an equivalent domain name 395 satisfying this requirement can be obtained by applying the 396 397 398 399 400 Faltstrom, et al. Standards Track [Page 7] 401 403 RFC 3490 IDNA March 2003 404 405 406 ToASCII operation (see section 4) to each label and, if dots are 407 used as label separators, changing all the label separators to 408 U+002E. 409 410 3) ACE labels obtained from domain name slots SHOULD be hidden from 411 users when it is known that the environment can handle the non-ACE 412 form, except when the ACE form is explicitly requested. When it 413 is not known whether or not the environment can handle the non-ACE 414 form, the application MAY use the non-ACE form (which might fail, 415 such as by not being displayed properly), or it MAY use the ACE 416 form (which will look unintelligle to the user). Given an 417 internationalized domain name, an equivalent domain name 418 containing no ACE labels can be obtained by applying the ToUnicode 419 operation (see section 4) to each label. When requirements 2 and 420 3 both apply, requirement 2 takes precedence. 421 422 4) Whenever two labels are compared, they MUST be considered to match 423 if and only if they are equivalent, that is, their ASCII forms 424 (obtained by applying ToASCII) match using a case-insensitive 425 ASCII comparison. Whenever two names are compared, they MUST be 426 considered to match if and only if their corresponding labels 427 match, regardless of whether the names use the same forms of label 428 separators. 429 430 3.2 Applicability 431 432 IDNA is applicable to all domain names in all domain name slots 433 except where it is explicitly excluded. 434 435 This implies that IDNA is applicable to many protocols that predate 436 IDNA. Note that IDNs occupying domain name slots in those protocols 437 MUST be in ASCII form (see section 3.1, requirement 2). 438 439 3.2.1. DNS resource records 440 441 IDNA does not apply to domain names in the NAME and RDATA fields of 442 DNS resource records whose CLASS is not IN. This exclusion applies 443 to every non-IN class, present and future, except where future 444 standards override this exclusion by explicitly inviting the use of 445 IDNA. 446 447 There are currently no other exclusions on the applicability of IDNA 448 to DNS resource records; it depends entirely on the CLASS, and not on 449 the TYPE. This will remain true, even as new types are defined, 450 unless there is a compelling reason for a new type to complicate 451 matters by imposing type-specific rules. 452 453 454 455 456 457 Faltstrom, et al. Standards Track [Page 8] 458 460 RFC 3490 IDNA March 2003 461 462 463 3.2.2. Non-domain-name data types stored in domain names 464 465 Although IDNA enables the representation of non-ASCII characters in 466 domain names, that does not imply that IDNA enables the 467 representation of non-ASCII characters in other data types that are 468 stored in domain names. For example, an email address local part is 469 sometimes stored in a domain label (hostmaster (a] example.com would be 470 represented as hostmaster.example.com in the RDATA field of an SOA 471 record). IDNA does not update the existing email standards, which 472 allow only ASCII characters in local parts. Therefore, unless the 473 email standards are revised to invite the use of IDNA for local 474 parts, a domain label that holds the local part of an email address 475 SHOULD NOT begin with the ACE prefix, and even if it does, it is to 476 be interpreted literally as a local part that happens to begin with 477 the ACE prefix. 478 479 4. Conversion operations 480 481 An application converts a domain name put into an IDN-unaware slot or 482 displayed to a user. This section specifies the steps to perform in 483 the conversion, and the ToASCII and ToUnicode operations. 484 485 The input to ToASCII or ToUnicode is a single label that is a 486 sequence of Unicode code points (remember that all ASCII code points 487 are also Unicode code points). If a domain name is represented using 488 a character set other than Unicode or US-ASCII, it will first need to 489 be transcoded to Unicode. 490 491 Starting from a whole domain name, the steps that an application 492 takes to do the conversions are: 493 494 1) Decide whether the domain name is a "stored string" or a "query 495 string" as described in [STRINGPREP]. If this conversion follows 496 the "queries" rule from [STRINGPREP], set the flag called 497 "AllowUnassigned". 498 499 2) Split the domain name into individual labels as described in 500 section 3.1. The labels do not include the separator. 501 502 3) For each label, decide whether or not to enforce the restrictions 503 on ASCII characters in host names [STD3]. (Applications already 504 faced this choice before the introduction of IDNA, and can 505 continue to make the decision the same way they always have; IDNA 506 makes no new recommendations regarding this choice.) If the 507 restrictions are to be enforced, set the flag called 508 "UseSTD3ASCIIRules" for that label. 509 510 511 512 513 514 Faltstrom, et al. Standards Track [Page 9] 515 517 RFC 3490 IDNA March 2003 518 519 520 4) Process each label with either the ToASCII or the ToUnicode 521 operation as appropriate. Typically, you use the ToASCII 522 operation if you are about to put the name into an IDN-unaware 523 slot, and you use the ToUnicode operation if you are displaying 524 the name to a user; section 3.1 gives greater detail on the 525 applicable requirements. 526 527 5) If ToASCII was applied in step 4 and dots are used as label 528 separators, change all the label separators to U+002E (full stop). 529 530 The following two subsections define the ToASCII and ToUnicode 531 operations that are used in step 4. 532 533 This description of the protocol uses specific procedure names, names 534 of flags, and so on, in order to facilitate the specification of the 535 protocol. These names, as well as the actual steps of the 536 procedures, are not required of an implementation. In fact, any 537 implementation which has the same external behavior as specified in 538 this document conforms to this specification. 539 540 4.1 ToASCII 541 542 The ToASCII operation takes a sequence of Unicode code points that 543 make up one label and transforms it into a sequence of code points in 544 the ASCII range (0..7F). If ToASCII succeeds, the original sequence 545 and the resulting sequence are equivalent labels. 546 547 It is important to note that the ToASCII operation can fail. ToASCII 548 fails if any step of it fails. If any step of the ToASCII operation 549 fails on any label in a domain name, that domain name MUST NOT be 550 used as an internationalized domain name. The method for dealing 551 with this failure is application-specific. 552 553 The inputs to ToASCII are a sequence of code points, the 554 AllowUnassigned flag, and the UseSTD3ASCIIRules flag. The output of 555 ToASCII is either a sequence of ASCII code points or a failure 556 condition. 557 558 ToASCII never alters a sequence of code points that are all in the 559 ASCII range to begin with (although it could fail). Applying the 560 ToASCII operation multiple times has exactly the same effect as 561 applying it just once. 562 563 ToASCII consists of the following steps: 564 565 1. If the sequence contains any code points outside the ASCII range 566 (0..7F) then proceed to step 2, otherwise skip to step 3. 567 568 569 570 571 Faltstrom, et al. Standards Track [Page 10] 572 574 RFC 3490 IDNA March 2003 575 576 577 2. Perform the steps specified in [NAMEPREP] and fail if there is an 578 error. The AllowUnassigned flag is used in [NAMEPREP]. 579 580 3. If the UseSTD3ASCIIRules flag is set, then perform these checks: 581 582 (a) Verify the absence of non-LDH ASCII code points; that is, the 583 absence of 0..2C, 2E..2F, 3A..40, 5B..60, and 7B..7F. 584 585 (b) Verify the absence of leading and trailing hyphen-minus; that 586 is, the absence of U+002D at the beginning and end of the 587 sequence. 588 589 4. If the sequence contains any code points outside the ASCII range 590 (0..7F) then proceed to step 5, otherwise skip to step 8. 591 592 5. Verify that the sequence does NOT begin with the ACE prefix. 593 594 6. Encode the sequence using the encoding algorithm in [PUNYCODE] and 595 fail if there is an error. 596 597 7. Prepend the ACE prefix. 598 599 8. Verify that the number of code points is in the range 1 to 63 600 inclusive. 601 602 4.2 ToUnicode 603 604 The ToUnicode operation takes a sequence of Unicode code points that 605 make up one label and returns a sequence of Unicode code points. If 606 the input sequence is a label in ACE form, then the result is an 607 equivalent internationalized label that is not in ACE form, otherwise 608 the original sequence is returned unaltered. 609 610 ToUnicode never fails. If any step fails, then the original input 611 sequence is returned immediately in that step. 612 613 The ToUnicode output never contains more code points than its input. 614 Note that the number of octets needed to represent a sequence of code 615 points depends on the particular character encoding used. 616 617 The inputs to ToUnicode are a sequence of code points, the 618 AllowUnassigned flag, and the UseSTD3ASCIIRules flag. The output of 619 ToUnicode is always a sequence of Unicode code points. 620 621 1. If all code points in the sequence are in the ASCII range (0..7F) 622 then skip to step 3. 623 624 625 626 627 628 Faltstrom, et al. Standards Track [Page 11] 629 631 RFC 3490 IDNA March 2003 632 633 634 2. Perform the steps specified in [NAMEPREP] and fail if there is an 635 error. (If step 3 of ToASCII is also performed here, it will not 636 affect the overall behavior of ToUnicode, but it is not 637 necessary.) The AllowUnassigned flag is used in [NAMEPREP]. 638 639 3. Verify that the sequence begins with the ACE prefix, and save a 640 copy of the sequence. 641 642 4. Remove the ACE prefix. 643 644 5. Decode the sequence using the decoding algorithm in [PUNYCODE] and 645 fail if there is an error. Save a copy of the result of this 646 step. 647 648 6. Apply ToASCII. 649 650 7. Verify that the result of step 6 matches the saved copy from step 651 3, using a case-insensitive ASCII comparison. 652 653 8. Return the saved copy from step 5. 654 655 5. ACE prefix 656 657 The ACE prefix, used in the conversion operations (section 4), is two 658 alphanumeric ASCII characters followed by two hyphen-minuses. It 659 cannot be any of the prefixes already used in earlier documents, 660 which includes the following: "bl--", "bq--", "dq--", "lq--", "mq--", 661 "ra--", "wq--" and "zq--". The ToASCII and ToUnicode operations MUST 662 recognize the ACE prefix in a case-insensitive manner. 663 664 The ACE prefix for IDNA is "xn--" or any capitalization thereof. 665 666 This means that an ACE label might be "xn--de-jg4avhby1noc0d", where 667 "de-jg4avhby1noc0d" is the part of the ACE label that is generated by 668 the encoding steps in [PUNYCODE]. 669 670 While all ACE labels begin with the ACE prefix, not all labels 671 beginning with the ACE prefix are necessarily ACE labels. Non-ACE 672 labels that begin with the ACE prefix will confuse users and SHOULD 673 NOT be allowed in DNS zones. 674 675 676 677 678 679 680 681 682 683 684 685 Faltstrom, et al. Standards Track [Page 12] 686 688 RFC 3490 IDNA March 2003 689 690 691 6. Implications for typical applications using DNS 692 693 In IDNA, applications perform the processing needed to input 694 internationalized domain names from users, display internationalized 695 domain names to users, and process the inputs and outputs from DNS 696 and other protocols that carry domain names. 697 698 The components and interfaces between them can be represented 699 pictorially as: 700 701 +------+ 702 | User | 703 +------+ 704 ^ 705 | Input and display: local interface methods 706 | (pen, keyboard, glowing phosphorus, ...) 707 +-------------------|-------------------------------+ 708 | v | 709 | +-----------------------------+ | 710 | | Application | | 711 | | (ToASCII and ToUnicode | | 712 | | operations may be | | 713 | | called here) | | 714 | +-----------------------------+ | 715 | ^ ^ | End system 716 | | | | 717 | Call to resolver: | | Application-specific | 718 | ACE | | protocol: | 719 | v | ACE unless the | 720 | +----------+ | protocol is updated | 721 | | Resolver | | to handle other | 722 | +----------+ | encodings | 723 | ^ | | 724 +-----------------|----------|----------------------+ 725 DNS protocol: | | 726 ACE | | 727 v v 728 +-------------+ +---------------------+ 729 | DNS servers | | Application servers | 730 +-------------+ +---------------------+ 731 732 The box labeled "Application" is where the application splits a 733 domain name into labels, sets the appropriate flags, and performs the 734 ToASCII and ToUnicode operations. This is described in section 4. 735 736 737 738 739 740 741 742 Faltstrom, et al. Standards Track [Page 13] 743 745 RFC 3490 IDNA March 2003 746 747 748 6.1 Entry and display in applications 749 750 Applications can accept domain names using any character set or sets 751 desired by the application developer, and can display domain names in 752 any charset. That is, the IDNA protocol does not affect the 753 interface between users and applications. 754 755 An IDNA-aware application can accept and display internationalized 756 domain names in two formats: the internationalized character set(s) 757 supported by the application, and as an ACE label. ACE labels that 758 are displayed or input MUST always include the ACE prefix. 759 Applications MAY allow input and display of ACE labels, but are not 760 encouraged to do so except as an interface for special purposes, 761 possibly for debugging, or to cope with display limitations as 762 described in section 6.4.. ACE encoding is opaque and ugly, and 763 should thus only be exposed to users who absolutely need it. Because 764 name labels encoded as ACE name labels can be rendered either as the 765 encoded ASCII characters or the proper decoded characters, the 766 application MAY have an option for the user to select the preferred 767 method of display; if it does, rendering the ACE SHOULD NOT be the 768 default. 769 770 Domain names are often stored and transported in many places. For 771 example, they are part of documents such as mail messages and web 772 pages. They are transported in many parts of many protocols, such as 773 both the control commands and the RFC 2822 body parts of SMTP, and 774 the headers and the body content in HTTP. It is important to 775 remember that domain names appear both in domain name slots and in 776 the content that is passed over protocols. 777 778 In protocols and document formats that define how to handle 779 specification or negotiation of charsets, labels can be encoded in 780 any charset allowed by the protocol or document format. If a 781 protocol or document format only allows one charset, the labels MUST 782 be given in that charset. 783 784 In any place where a protocol or document format allows transmission 785 of the characters in internationalized labels, internationalized 786 labels SHOULD be transmitted using whatever character encoding and 787 escape mechanism that the protocol or document format uses at that 788 place. 789 790 All protocols that use domain name slots already have the capacity 791 for handling domain names in the ASCII charset. Thus, ACE labels 792 (internationalized labels that have been processed with the ToASCII 793 operation) can inherently be handled by those protocols. 794 795 796 797 798 799 Faltstrom, et al. Standards Track [Page 14] 800 802 RFC 3490 IDNA March 2003 803 804 805 6.2 Applications and resolver libraries 806 807 Applications normally use functions in the operating system when they 808 resolve DNS queries. Those functions in the operating system are 809 often called "the resolver library", and the applications communicate 810 with the resolver libraries through a programming interface (API). 811 812 Because these resolver libraries today expect only domain names in 813 ASCII, applications MUST prepare labels that are passed to the 814 resolver library using the ToASCII operation. Labels received from 815 the resolver library contain only ASCII characters; internationalized 816 labels that cannot be represented directly in ASCII use the ACE form. 817 ACE labels always include the ACE prefix. 818 819 An operating system might have a set of libraries for performing the 820 ToASCII operation. The input to such a library might be in one or 821 more charsets that are used in applications (UTF-8 and UTF-16 are 822 likely candidates for almost any operating system, and script- 823 specific charsets are likely for localized operating systems). 824 825 IDNA-aware applications MUST be able to work with both non- 826 internationalized labels (those that conform to [STD13] and [STD3]) 827 and internationalized labels. 828 829 It is expected that new versions of the resolver libraries in the 830 future will be able to accept domain names in other charsets than 831 ASCII, and application developers might one day pass not only domain 832 names in Unicode, but also in local script to a new API for the 833 resolver libraries in the operating system. Thus the ToASCII and 834 ToUnicode operations might be performed inside these new versions of 835 the resolver libraries. 836 837 Domain names passed to resolvers or put into the question section of 838 DNS requests follow the rules for "queries" from [STRINGPREP]. 839 840 6.3 DNS servers 841 842 Domain names stored in zones follow the rules for "stored strings" 843 from [STRINGPREP]. 844 845 For internationalized labels that cannot be represented directly in 846 ASCII, DNS servers MUST use the ACE form produced by the ToASCII 847 operation. All IDNs served by DNS servers MUST contain only ASCII 848 characters. 849 850 If a signaling system which makes negotiation possible between old 851 and new DNS clients and servers is standardized in the future, the 852 encoding of the query in the DNS protocol itself can be changed from 853 854 855 856 Faltstrom, et al. Standards Track [Page 15] 857 859 RFC 3490 IDNA March 2003 860 861 862 ACE to something else, such as UTF-8. The question whether or not 863 this should be used is, however, a separate problem and is not 864 discussed in this memo. 865 866 6.4 Avoiding exposing users to the raw ACE encoding 867 868 Any application that might show the user a domain name obtained from 869 a domain name slot, such as from gethostbyaddr or part of a mail 870 header, will need to be updated if it is to prevent users from seeing 871 the ACE. 872 873 If an application decodes an ACE name using ToUnicode but cannot show 874 all of the characters in the decoded name, such as if the name 875 contains characters that the output system cannot display, the 876 application SHOULD show the name in ACE format (which always includes 877 the ACE prefix) instead of displaying the name with the replacement 878 character (U+FFFD). This is to make it easier for the user to 879 transfer the name correctly to other programs. Programs that by 880 default show the ACE form when they cannot show all the characters in 881 a name label SHOULD also have a mechanism to show the name that is 882 produced by the ToUnicode operation with as many characters as 883 possible and replacement characters in the positions where characters 884 cannot be displayed. 885 886 The ToUnicode operation does not alter labels that are not valid ACE 887 labels, even if they begin with the ACE prefix. After ToUnicode has 888 been applied, if a label still begins with the ACE prefix, then it is 889 not a valid ACE label, and is not equivalent to any of the 890 intermediate Unicode strings constructed by ToUnicode. 891 892 6.5 DNSSEC authentication of IDN domain names 893 894 DNS Security [RFC2535] is a method for supplying cryptographic 895 verification information along with DNS messages. Public Key 896 Cryptography is used in conjunction with digital signatures to 897 provide a means for a requester of domain information to authenticate 898 the source of the data. This ensures that it can be traced back to a 899 trusted source, either directly, or via a chain of trust linking the 900 source of the information to the top of the DNS hierarchy. 901 902 IDNA specifies that all internationalized domain names served by DNS 903 servers that cannot be represented directly in ASCII must use the ACE 904 form produced by the ToASCII operation. This operation must be 905 performed prior to a zone being signed by the private key for that 906 zone. Because of this ordering, it is important to recognize that 907 DNSSEC authenticates the ASCII domain name, not the Unicode form or 908 909 910 911 912 913 Faltstrom, et al. Standards Track [Page 16] 914 916 RFC 3490 IDNA March 2003 917 918 919 the mapping between the Unicode form and the ASCII form. In the 920 presence of DNSSEC, this is the name that MUST be signed in the zone 921 and MUST be validated against. 922 923 One consequence of this for sites deploying IDNA in the presence of 924 DNSSEC is that any special purpose proxies or forwarders used to 925 transform user input into IDNs must be earlier in the resolution flow 926 than DNSSEC authenticating nameservers for DNSSEC to work. 927 928 7. Name server considerations 929 930 Existing DNS servers do not know the IDNA rules for handling non- 931 ASCII forms of IDNs, and therefore need to be shielded from them. 932 All existing channels through which names can enter a DNS server 933 database (for example, master files [STD13] and DNS update messages 934 [RFC2136]) are IDN-unaware because they predate IDNA, and therefore 935 requirement 2 of section 3.1 of this document provides the needed 936 shielding, by ensuring that internationalized domain names entering 937 DNS server databases through such channels have already been 938 converted to their equivalent ASCII forms. 939 940 It is imperative that there be only one ASCII encoding for a 941 particular domain name. Because of the design of the ToASCII and 942 ToUnicode operations, there are no ACE labels that decode to ASCII 943 labels, and therefore name servers cannot contain multiple ASCII 944 encodings of the same domain name. 945 946 [RFC2181] explicitly allows domain labels to contain octets beyond 947 the ASCII range (0..7F), and this document does not change that. 948 Note, however, that there is no defined interpretation of octets 949 80..FF as characters. If labels containing these octets are returned 950 to applications, unpredictable behavior could result. The ASCII form 951 defined by ToASCII is the only standard representation for 952 internationalized labels in the current DNS protocol. 953 954 8. Root server considerations 955 956 IDNs are likely to be somewhat longer than current domain names, so 957 the bandwidth needed by the root servers is likely to go up by a 958 small amount. Also, queries and responses for IDNs will probably be 959 somewhat longer than typical queries today, so more queries and 960 responses may be forced to go to TCP instead of UDP. 961 962 963 964 965 966 967 968 969 970 Faltstrom, et al. Standards Track [Page 17] 971 973 RFC 3490 IDNA March 2003 974 975 976 9. References 977 978 9.1 Normative References 979 980 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 981 Requirement Levels", BCP 14, RFC 2119, March 1997. 982 983 [STRINGPREP] Hoffman, P. and M. Blanchet, "Preparation of 984 Internationalized Strings ("stringprep")", RFC 3454, 985 December 2002. 986 987 [NAMEPREP] Hoffman, P. and M. Blanchet, "Nameprep: A Stringprep 988 Profile for Internationalized Domain Names (IDN)", RFC 989 3491, March 2003. 990 991 [PUNYCODE] Costello, A., "Punycode: A Bootstring encoding of 992 Unicode for use with Internationalized Domain Names in 993 Applications (IDNA)", RFC 3492, March 2003. 994 995 [STD3] Braden, R., "Requirements for Internet Hosts -- 996 Communication Layers", STD 3, RFC 1122, and 997 "Requirements for Internet Hosts -- Application and 998 Support", STD 3, RFC 1123, October 1989. 999 1000 [STD13] Mockapetris, P., "Domain names - concepts and 1001 facilities", STD 13, RFC 1034 and "Domain names - 1002 implementation and specification", STD 13, RFC 1035, 1003 November 1987. 1004 1005 9.2 Informative References 1006 1007 [RFC2535] Eastlake, D., "Domain Name System Security Extensions", 1008 RFC 2535, March 1999. 1009 1010 [RFC2181] Elz, R. and R. Bush, "Clarifications to the DNS 1011 Specification", RFC 2181, July 1997. 1012 1013 [UAX9] Unicode Standard Annex #9, The Bidirectional Algorithm, 1014 <http://www.unicode.org/unicode/reports/tr9/>. 1015 1016 [UNICODE] The Unicode Consortium. The Unicode Standard, Version 1017 3.2.0 is defined by The Unicode Standard, Version 3.0 1018 (Reading, MA, Addison-Wesley, 2000. ISBN 0-201-61633-5), 1019 as amended by the Unicode Standard Annex #27: Unicode 1020 3.1 (http://www.unicode.org/reports/tr27/) and by the 1021 Unicode Standard Annex #28: Unicode 3.2 1022 (http://www.unicode.org/reports/tr28/). 1023 1024 1025 1026 1027 Faltstrom, et al. Standards Track [Page 18] 1028 1030 RFC 3490 IDNA March 2003 1031 1032 1033 [USASCII] Cerf, V., "ASCII format for Network Interchange", RFC 1034 20, October 1969. 1035 1036 10. Security Considerations 1037 1038 Security on the Internet partly relies on the DNS. Thus, any change 1039 to the characteristics of the DNS can change the security of much of 1040 the Internet. 1041 1042 This memo describes an algorithm which encodes characters that are 1043 not valid according to STD3 and STD13 into octet values that are 1044 valid. No security issues such as string length increases or new 1045 allowed values are introduced by the encoding process or the use of 1046 these encoded values, apart from those introduced by the ACE encoding 1047 itself. 1048 1049 Domain names are used by users to identify and connect to Internet 1050 servers. The security of the Internet is compromised if a user 1051 entering a single internationalized name is connected to different 1052 servers based on different interpretations of the internationalized 1053 domain name. 1054 1055 When systems use local character sets other than ASCII and Unicode, 1056 this specification leaves the the problem of transcoding between the 1057 local character set and Unicode up to the application. If different 1058 applications (or different versions of one application) implement 1059 different transcoding rules, they could interpret the same name 1060 differently and contact different servers. This problem is not 1061 solved by security protocols like TLS that do not take local 1062 character sets into account. 1063 1064 Because this document normatively refers to [NAMEPREP], [PUNYCODE], 1065 and [STRINGPREP], it includes the security considerations from those 1066 documents as well. 1067 1068 If or when this specification is updated to use a more recent Unicode 1069 normalization table, the new normalization table will need to be 1070 compared with the old to spot backwards incompatible changes. If 1071 there are such changes, they will need to be handled somehow, or 1072 there will be security as well as operational implications. Methods 1073 to handle the conflicts could include keeping the old normalization, 1074 or taking care of the conflicting characters by operational means, or 1075 some other method. 1076 1077 Implementations MUST NOT use more recent normalization tables than 1078 the one referenced from this document, even though more recent tables 1079 may be provided by operating systems. If an application is unsure of 1080 which version of the normalization tables are in the operating 1081 1082 1083 1084 Faltstrom, et al. Standards Track [Page 19] 1085 1087 RFC 3490 IDNA March 2003 1088 1089 1090 system, the application needs to include the normalization tables 1091 itself. Using normalization tables other than the one referenced 1092 from this specification could have security and operational 1093 implications. 1094 1095 To help prevent confusion between characters that are visually 1096 similar, it is suggested that implementations provide visual 1097 indications where a domain name contains multiple scripts. Such 1098 mechanisms can also be used to show when a name contains a mixture of 1099 simplified and traditional Chinese characters, or to distinguish zero 1100 and one from O and l. DNS zone adminstrators may impose restrictions 1101 (subject to the limitations in section 2) that try to minimize 1102 homographs. 1103 1104 Domain names (or portions of them) are sometimes compared against a 1105 set of privileged or anti-privileged domains. In such situations it 1106 is especially important that the comparisons be done properly, as 1107 specified in section 3.1 requirement 4. For labels already in ASCII 1108 form, the proper comparison reduces to the same case-insensitive 1109 ASCII comparison that has always been used for ASCII labels. 1110 1111 The introduction of IDNA means that any existing labels that start 1112 with the ACE prefix and would be altered by ToUnicode will 1113 automatically be ACE labels, and will be considered equivalent to 1114 non-ASCII labels, whether or not that was the intent of the zone 1115 adminstrator or registrant. 1116 1117 11. IANA Considerations 1118 1119 IANA has assigned the ACE prefix in consultation with the IESG. 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 Faltstrom, et al. Standards Track [Page 20] 1142 1144 RFC 3490 IDNA March 2003 1145 1146 1147 12. Authors' Addresses 1148 1149 Patrik Faltstrom 1150 Cisco Systems 1151 Arstaangsvagen 31 J 1152 S-117 43 Stockholm Sweden 1153 1154 EMail: paf (a] cisco.com 1155 1156 1157 Paul Hoffman 1158 Internet Mail Consortium and VPN Consortium 1159 127 Segre Place 1160 Santa Cruz, CA 95060 USA 1161 1162 EMail: phoffman (a] imc.org 1163 1164 1165 Adam M. Costello 1166 University of California, Berkeley 1167 1168 URL: http://www.nicemice.net/amc/ 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 Faltstrom, et al. Standards Track [Page 21] 1199 1201 RFC 3490 IDNA March 2003 1202 1203 1204 13. Full Copyright Statement 1205 1206 Copyright (C) The Internet Society (2003). All Rights Reserved. 1207 1208 This document and translations of it may be copied and furnished to 1209 others, and derivative works that comment on or otherwise explain it 1210 or assist in its implementation may be prepared, copied, published 1211 and distributed, in whole or in part, without restriction of any 1212 kind, provided that the above copyright notice and this paragraph are 1213 included on all such copies and derivative works. However, this 1214 document itself may not be modified in any way, such as by removing 1215 the copyright notice or references to the Internet Society or other 1216 Internet organizations, except as needed for the purpose of 1217 developing Internet standards in which case the procedures for 1218 copyrights defined in the Internet Standards process must be 1219 followed, or as required to translate it into languages other than 1220 English. 1221 1222 The limited permissions granted above are perpetual and will not be 1223 revoked by the Internet Society or its successors or assigns. 1224 1225 This document and the information contained herein is provided on an 1226 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 1227 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 1228 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 1229 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 1230 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 1231 1232 Acknowledgement 1233 1234 Funding for the RFC Editor function is currently provided by the 1235 Internet Society. 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 Faltstrom, et al. Standards Track [Page 22] 1256 1258