NAPTR record
What is NAPTR record?
A NAPTR (Naming Authority Pointer) record is a DNS record, defined in RFC 3403, that rewrites a string such as a phone number or domain into a new name or URI using order, preference, flags, service and regexp fields. SIP and ENUM rely on it, and AdminKit's SRV record generator builds the record it often points to.
By AdminKit team, Netbase JSC · Updated
A NAPTR (Naming Authority Pointer) record is a DNS record that takes an input string, such as a domain or a telephone number, and rewrites it into something a client can act on next: another domain name to look up, or a URI. It is the DNS storage layer of the Dynamic Delegation Discovery System (DDDS), defined in RFC 3403. The Amazon Route 53 record type reference gives converting phone numbers into SIP URIs as one common use, and documents the six space-separated values a NAPTR record holds: order, preference, flags, service, regexp and replacement.
How does a NAPTR lookup work?
A client asks for NAPTR records at a name, then sorts the answers by order and, among records with the same order, by preference. The flags field says what the client should do with the result. In SIP, RFC 3263 uses records with the s flag, which means “look up an SRV record next”. Its example points SIPS over TCP to the matching SRV record:
example.com. IN NAPTR 50 50 "s" "SIPS+D2T" "" _sips._tcp.example.com.
The SRV record then gives the hostname and port, so a phone that knows only the domain can find the right server and transport. A domain with only SRV records and no NAPTR records still works, because RFC 3263 lets clients fall back to querying SRV directly.
ENUM, specified in RFC 6116, applies the same record to telephone numbers. The number’s digits are reversed, separated by dots and placed under e164.arpa, and NAPTR records at that name map the number to URIs. The Kamailio enum module documentation shows the mapping for the number +35831234567, then describes how the SIP server keeps the records whose flags are u and whose service names SIP, and sorts them by order and preference:
7.6.5.4.3.2.1.3.8.5.3.e164.arpa.
Delegation of country codes in that tree is coordinated with the telephone numbering authority: the ITU-T ENUM delegations page describes ENUM as a method for entering E.164 country codes into the Domain Name System.
AdminKit’s DNS lookup tool does not query the NAPTR type, so check a NAPTR record from a terminal:
dig NAPTR example.com +short
To publish the SRV record a SIP NAPTR record points to, AdminKit’s SRV record generator turns a service, protocol, port and target into a zone-file line in your browser. For the exposure side of VoIP, AdminKit’s guide on whether port 5060 (SIP) is exposed shows how to test your own SIP server from outside and restrict it.
NAPTR record is part of AdminKit’s DNS cluster; the full AdminKit glossary lists other related terms.
Frequently asked questions
What fields does a NAPTR record have?
Six: order, preference, flags, service, regexp and replacement. Order and preference set the sequence in which records are tried, flags say what the next step is, service names the protocol or application, and either the regexp or the replacement field (not both) produces the output.
How does SIP use NAPTR records?
RFC 3263 has a SIP client look up NAPTR records for the target domain to learn which transports the domain supports, such as SIP over UDP, TCP or TLS. Each NAPTR record with the s flag then points to an SRV record that gives the hostname and port for that transport.
What is ENUM?
ENUM, specified in RFC 6116, turns an E.164 telephone number into a domain name under e164.arpa by reversing its digits and separating them with dots. NAPTR records published at that name map the number to URIs, for example a SIP address.
Can AdminKit's DNS lookup tool show NAPTR records?
No. The DNS lookup tool queries A, AAAA, MX, TXT, NS, CAA, PTR, SOA and CNAME records. To read a NAPTR record, query it with dig or your DNS provider's console.
Sources
- RFC 3403 — Dynamic Delegation Discovery System (DDDS) Part Three: The DNS Database
- RFC 6116 — The E.164 to URI DDDS Application (ENUM)
- RFC 3263 — Session Initiation Protocol (SIP): Locating SIP Servers
- Amazon Route 53 Developer Guide -- Supported DNS record types (NAPTR)
- Kamailio -- enum module documentation
- ITU-T -- ENUM delegations