RFC 2916

E.164 number and DNS

๐Ÿ“… published September 2000, from ietf

E.164 number and DNS ๐Ÿ“ž๐ŸŽ€

RFC 2916: E.164 number and DNS ๐Ÿ’– Author: P. Faltstrom, Cisco Systems Inc. ๐Ÿ‘‘ Stream: Network Working Group ๐ŸŒธ Category: Standards Track โœจ Date: September 2000 ๐Ÿฆ‹ Obsoletes / Updates: The title block doesn't list anything this one obsoletes or updates ๐Ÿงš


Status of This Memo ๐Ÿ“œ

okay so this doc is an Internet standards track protocol, and the community is literally invited to talk about it and suggest improvements ๐Ÿซถ for the current standardization state and status, check the "Internet Official Protocol Standards" (STD 1) ๐Ÿ”ฅ and yes, distribution of this memo is unlimited, so share it bestie ๐Ÿ’…

Copyright (C) The Internet Society (2000). All Rights Reserved. ๐Ÿ’œ

Abstract โœจ

this doc is about using the Domain Name System (DNS) to store E.164 numbers ๐Ÿ“ž the main vibe is how DNS can help you find the services that are connected to one E.164 number ๐Ÿฆ‹ routing the actual connection using whatever service you picked is NOT covered here, so don't come for me about it ๐Ÿ™ˆ

1. Introduction ๐ŸŒˆ

so the magic here is turning E.164 numbers into DNS names ๐Ÿช„ then you use existing DNS stuff like delegation through NS records, plus NAPTR [1] records in DNS [2] [3], and boom, you can look up what services are available for a specific domain name ๐Ÿ’– it's decentralized too, so the different levels of the lookup process are managed separately ๐Ÿซถ iconic behavior ngl

1.1. Terminology ๐Ÿ“–

the key words "MUST", "REQUIRED", "SHOULD", "RECOMMENDED", and "MAY" in this document are to be interpreted as described in RFC2119 [4] ๐Ÿ’… so when you see them in caps, they carry the official weight ๐Ÿ”ฅ

2. E.164 numbers and DNS ๐Ÿ“ž

the domain "e164.arpa" is getting populated ๐ŸŒธ to make the whole thing work across lots of people, the domain gets split into subdomains ๐Ÿ“ if you hold an E.164 number and you want it listed in DNS, you should contact the appropriate zone administrator, and you can find who that is by checking the SOA resource record for the zone, same as normal DNS stuff โœจ

of course, the rules for listings get controlled on a subdomain basis, and they may be different in different parts of the world ๐ŸŒ different vibes everywhere, periodt ๐Ÿ’€

to find the DNS names for one E.164 number, follow these steps ๐Ÿงš:

  1. Write the E.164 number in its full form, including the country code IDDD. Example: +46-8-9761234
  2. Remove all non-digit characters except for the leading '+'. Example: +4689761234
  3. Remove all characters except the digits. Example: 4689761234
  4. Put dots (".") between each digit. Example: 4.6.8.9.7.6.1.2.3.4
  5. Reverse the order of the digits. Example: 4.3.2.1.6.7.9.8.6.4
  6. Append the string ".e164.arpa" to the end. Example: 4.3.2.1.6.7.9.8.6.4.e164.arpa

2.1. Special note about the '+' โญ

the '+' sticks around in step 2 of section 2 to flag that the number the regular expression is working on is an E.164 number ๐ŸŽ€ figuring out how other numbering plans (like closed ones) get identified is future work ๐Ÿ”ฎ it's possible, but not definite, that they'd use a similar mechanism to the one in this doc ๐Ÿคž

3. Fetching URIs given an E.164 number ๐Ÿฆ‹

for a record in DNS, the NAPTR record is what tells you the available ways to contact a specific node identified by that name ๐Ÿ’– specifically, it can show you what services exist for a domain name, including phone numbers through the e164.arpa domain we just talked about ๐Ÿ“ž

the identification uses the NAPTR resource record that's defined for the URN resolution process, but it can be generalized to fit the needs in this doc โœจ

the input to the NAPTR algorithm is the string that comes out of step 2 in section 2 above ๐Ÿงš

3.1. The NAPTR record ๐ŸŒธ

the key fields in the NAPTR RR are order, preference, service, flags, regexp, and replacement ๐Ÿ’… for a detailed description, check out:

  • The order field specifies the order in which records MUST be processed when multiple NAPTR records come back for a single query. ๐Ÿ‘‘
  • The preference field specifies the order in which records SHOULD be processed when multiple NAPTR records have the same value of "order". ๐Ÿซถ
  • The service field specifies the resolution protocol and resolution service(s) that will be available if the rewrite in the regexp or replacement fields is applied. ๐Ÿ”ฅ
  • The flags field has modifiers that affect what happens in the next DNS lookup, usually for optimizing the process. โญ
  • The regexp field is one of the two fields used for rewrite rules, and it's the core concept of the NAPTR record ๐Ÿ’–
  • The replacement field is the other field that may be used for the rewrite rule. ๐Ÿฆ‹

note that the client does all the substitutions and all the lookups, they are NOT done in the DNS servers ๐Ÿ™Œ and URIs get stored in the regexp field ๐Ÿ’œ

3.1.1. Specification for use of NAPTR Resource Records ๐Ÿ“œ

the input is an E.164 encoded telephone number ๐Ÿ“ž the output is a Uniform Resource Identifier in its absolute form, following the 'absoluteURI' production in the Collected ABNF found in RFC2396 [5] ๐ŸŒˆ

an E.164 number, with nothing but a leading '+' and digits (the result of step 2 in section 2 above), is what goes into the NAPTR algorithm ๐Ÿงš

the one service supported for a call is E2U โœจ

3.1.2. Specification of Service E2U (E.164 to URI) ๐ŸŒŸ

this is the spec for E2U, the service that maps one E.164 number to a list of URIs ๐Ÿ’– the security part is seriously important, so read it carefully, bestie ๐Ÿ˜ญโš ๏ธ

* Name: E.164 to URI
* Mnemonic: E2U
* Number of Operands: 1
* Type of Each Operand: First operand is an E.164 number.
* Format of Each Operand: First operand is the E.164 number in the
  form as specified in step 2 in section 2 in this document.
* Algorithm: Opaque
* Output: One or more URIs
* Error Conditions:
   o E.164 number not in the numbering plan
   o E.164 number in the numbering plan, but no URIs exist for
     that number
   o Service unavailable

* Security Considerations:
   o Malicious Redirection
     One of the fundamental dangers related to any service such
     as this is that a malicious entry in a resolver's database
     will cause clients to resolve the E.164 into the wrong URI.
     The possible intent may be to cause the client to retrieve
     a resource containing fraudulent or damaging material.
   o Denial of Service
     By removing the URI to which the E.164 maps, a malicious
     intruder may remove the client's ability to access the
     resource.

this operation maps one E.164 number to a list of URIs ๐Ÿ—บ๏ธ the first well-known step in the resolution process is removing all non-digits except the leading '+' from the E.164 number, as described in steps 1 and 2 in section 2 of this document ๐Ÿงš

3.2. Examples ๐ŸŽ€

3.2.1. Example 1 ๐Ÿ’…

$ORIGIN 4.3.2.1.6.7.9.8.6.4.e164.arpa.
IN NAPTR 100 10 "u" "sip+E2U"    "!^.*$!sip:info@tele2.se!"     .
IN NAPTR 102 10 "u" "mailto+E2U" "!^.*$!mailto:info@tele2.se!"  .

this says the domain 4.3.2.1.6.7.9.8.6.4.e164.arpa is preferably contacted by SIP, and secondly by SMTP ๐Ÿ’–

in both cases, the next step is using the resolution mechanism for each protocol (SIP and SMTP) to figure out which node to contact for each one ๐Ÿ”ฅ

3.2.2. Example 2 ๐Ÿ“ž

$ORIGIN 4.3.2.1.6.7.9.8.6.4.e164.arpa.
 IN NAPTR  10 10 "u" "sip+E2U"     "!^.*$!sip:paf@swip.net!"    .
 IN NAPTR 102 10 "u" "mailto+E2U"  "!^.*$!mailto:paf@swip.net!" .
 IN NAPTR 102 10 "u" "tel+E2U"     "!^.*$!tel:+4689761234!"     .

note that SIP is the preferred method here ๐Ÿฆ‹ but the result of the NAPTR rewrite is a URI (that's what the "u" flag in the NAPTR record means) ๐ŸŒˆ for SIP, the URI might be a SIP URI, which gets resolved as described in RFC 2543 [6] โœจ for the "tel" URI scheme [7], the procedure starts over with this new E.164 number ๐Ÿ”„ the client is responsible for loop detection, so it's on them to catch the loops ๐Ÿงš

the rest of the routing resolution works the same way as described above ๐Ÿ’œ

3.2.3. Example 3 ๐ŸŒธ

   $ORIGIN 6.4.e164.arpa.
   * IN NAPTR 100 10 "u" "ldap+E2U" "!^+46(.*)$!ldap://ldap.se/cn=01!" .

in this one, all the E.164 numbers in the 46 country code (Sweden) are stored in an LDAP server ๐Ÿ‡ธ๐Ÿ‡ช and the search to run is specified by the LDAP URI [8] ๐ŸŒŸ

7. References ๐Ÿ“š

okay so the references are where the receipts live ๐Ÿงพโœจ every doc this spec leans on is listed here, with all the details, bestie

  • [1] Mealling, M. and R. Daniel, "The Naming Authority Pointer (NAPTR) DNS Resource Record", RFC 2915, September 2000. ๐Ÿ’œ
  • [2] Mockapetris, P., "Domain names - concepts and facilities", STD 13, RFC 1034, November 1987. ๐ŸŒธ
  • [3] Mockapetris, P., "Domain names - implementation and specification", STD 13, RFC 1035, November 1987. ๐ŸŒธ
  • [4] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. ๐Ÿ”ฅ
  • [5] Berners-Lee, T., Fielding, R.T. and L. Masinter, "Uniform Resource Identifiers (URI): Generic Syntax", RFC 2396, August 1998. ๐Ÿฆ‹
  • [6] Handley, M., Schulzrinne, H., Schooler, E. and J. Rosenberg, "SIP: Session Initiation Protocol", RFC 2543, March 1999. ๐Ÿ“ž
  • [7] Vaha-Sipila, A., "URLs for Telephone Calls", RFC 2806, April 2000. โ˜Ž๏ธ
  • [8] Howes, T. and M. Smith, "An LDAP URL Format", RFC 1959, June 1996. ๐Ÿงš
  • [9] Eastlake, D., "Domain Name System Security Extensions", RFC 2535, March 1999. ๐Ÿ”
  • [10] Gulbrandsen, A., Vixie, P. and L. Esibov, "A DNS RR for specifying the location of services (DNS SRV)", RFC 2782, February 2000. ๐ŸŽ€
  • [11] Droms, R., "Dynamic Host Configuration Protocol", RFC 2131, March 1997. ๐ŸŒˆ

Author's Address ๐Ÿ’โ€โ™€๏ธ

Meet Patrik Faltstrom, the author, who you can reach here ๐Ÿซถ

   Patrik Faltstrom
   Cisco Systems Inc
   170 W Tasman Drive SJ-13/2
   San Jose CA 95134
   USA

   EMail: paf@cisco.com
   URI:   http://www.cisco.com

Appendix A. Scenario ๐Ÿ•ต๏ธโ€โ™€๏ธ๐Ÿ’…

okay this appendix is literally a whole story time, and it's the best way to see how everything clicks together ๐Ÿ“ let's go!

Picture the e164.arpa zone holding this little bit of info:

   $ORIGIN e164.arpa.
   6.4 IN NS ns.regulator-e164.example.se.

The regulator then gave a series of 10000 numbers to a telco called Telco-A, and so the regulator put this in its DNS:

   $ORIGIN 6.4.e164.arpa.
   6.7.9.8 IN NS ns.telco-a.example.se.

Now our girl Sven Svensson got the phone number +46-8-9761234 from Telco A. He uses a company called Redirection Service to run his DNS. Sven asked Telco A to name Redirection Service as the authoritative source for info about +46-8-9761234, so Telco A added this to its DNS:

   $ORIGIN 6.7.9.8.6.4.e164.arpa.
   4.3.2.1 IN NS ns.redirection-service.example.se.

Sven already has plain telephony from Telco A, but he also has a SIP service from a company called Sip Service, which gives him the SIP URI "sip:sven@sips.se". His ISP, ISP A, runs his email and webpages, under the email address sven@ispa.se and the URI http://svensson.ispa.se. ๐Ÿ’Œ

So the DNS for Redirection Service ends up holding these records:

   $ORIGIN 4.3.2.1.6.7.9.8.6.4.e164.arpa.
    IN NAPTR 10 10 "u" "sip+E2U"    "!^.*$!sip:sven@sips.se!"        .
    IN NAPTR 10 10 "u" "mailto+E2U" "!^.*$!mailto:sven@ispa.se!"     .
    IN NAPTR 10 10 "u" "http+E2U"   "!^.*$!http://svensson.ispa.se!" .
    IN NAPTR 10 10 "u" "tel+E2U"    "!^.*$!tel:+46-8-9761234!"       .

Next, John Smith wants to contact Sven, but all he has is Sven's E.164 number, +46-8-9761234. He types that number into his communication client, which knows how to handle SIP. The client strips out the dashes and ends up with the E.164 number +4689761234. That's the string the NAPTR algorithm works on. โœจ

The client turns the E.164 number into the domain name 4.3.2.1.6.7.9.8.6.4.e164.arpa., then asks for NAPTR records for that domain name. Using normal DNS mechanisms, which include following the NS record referrals, these records come back:

   $ORIGIN 4.3.2.1.6.7.9.8.6.4.e164.arpa.
    IN NAPTR 10 10 "u" "sip+E2U"    "!^.*$!sip:sven@sips.se"        .
    IN NAPTR 10 10 "u" "mailto+E2U" "!^.*$!mailto:sven@ispa.se"     .
    IN NAPTR 10 10 "u" "http+E2U"   "!^.*$!http://svensson.ispa.se" .
    IN NAPTR 10 10 "u" "tel+E2U"    "!^.*$!tel:+46-8-9761234"       .

Because John's client knows SIP, it picks the first record, and it applies the regular expression "!^.*$!sip:sven@sips.se" to the original string, "+4689761234". The output is "sip:sven@sips.se", and that's what gets handed to SIP resolution. Iconic, honestly ๐Ÿ‘‘


Okay, the legal bit, but make it cute ๐ŸŽ€ Here's the deal:

Copyright (C) The Internet Society (2000). All Rights Reserved. ๐ŸŒท

You're allowed to copy this document and share it with others, and you can also write derivative works that comment on or explain it or help people implement it. Those works can be prepared, copied, published, and distributed, in whole or in part, without any restriction, as long as the copyright notice and this paragraph stay on all the copies and derivative works. The document itself, though, must not be modified in any way. That includes removing the copyright notice or the references to the Internet Society or other Internet organizations. The one exceptions are when you need it to develop Internet standards, in which case the copyright procedures defined in the Internet Standards process must be followed, or when you need it translated into languages other than English. ๐ŸŒ

The permissions above are perpetual, and the Internet Society or its successors or assigns will never revoke them. ๐Ÿ’–

This document and the info in it are provided on an "AS IS" basis, and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. ๐Ÿ™ˆ


Acknowledgement ๐Ÿซถ

Funding for the RFC Editor function is currently provided by the Internet Society. ๐Ÿ’œ๐ŸŒธ

๐Ÿ“ฆ where this page comes from