DNS NAPTR Record
Naming Authority Pointer RecordWhat is a NAPTR Record?
A DNS NAPTR record (Naming Authority Pointer record) is used to map between different naming or addressing systems using rewrite rules. It is a critical component of protocols like ENUM (E.164 Number Mapping), which maps telephone numbers to internet services, and URI resolution in SIP (Session Initiation Protocol) and other VoIP systems.
NAPTR records are more complex than most DNS record types because they contain regular expression-based rewrite rules. Each NAPTR record includes an order (processing priority), preference (among equal-order records), flags (indicating the next step), a service field (identifying the protocol), a regular expression (for string transformation), and a replacement domain. The combination of these fields allows for sophisticated routing decisions.
In the ENUM system, a phone number like +1-555-123-4567 is converted to a domain name (7.6.5.4.3.2.1.5.5.5.1.e164.arpa) and NAPTR records at that domain specify how to reach the owner via various services — SIP, email, web, etc. NAPTR records are also used in DDDS (Dynamic Delegation Discovery System) applications and can be chained with SRV records for complete service discovery.
Syntax & Examples
The syntax of a DNS NAPTR record includes multiple fields:
example.com. 3600 IN NAPTR 100 10 "u" "E2U+sip" "!^.*$!sip:[email protected]!" .
example.com. 3600 IN NAPTR 100 20 "u" "E2U+email" "!^.*$!mailto:[email protected]!" .
The fields are: domain, TTL, class, record type, order (lower = processed first), preference (among same-order records), flags ("u" = terminal URI, "s" = look up SRV, "a" = look up A/AAAA), service (protocol identifier), regexp (rewrite rule using ! as delimiter), and replacement (domain for further lookups, or '.' if regexp is used). An ENUM example for phone number +1-555-123-4567:
7.6.5.4.3.2.1.5.5.5.1.e164.arpa. IN NAPTR 100 10 "u" "E2U+sip" "!^\\+(.*)$!sip:\\[email protected]!" .
How to Query NAPTR Records
To query NAPTR records using dig, run: dig example.com NAPTR. For concise output: dig +short example.com NAPTR. For ENUM lookups, convert the phone number to the e164.arpa format first. For example, +15551234567 becomes: dig 7.6.5.4.3.2.1.5.5.5.1.e164.arpa NAPTR. The output shows order, preference, flags, service, regexp, and replacement for each record.
With nslookup, use: nslookup -type=NAPTR example.com. On Windows PowerShell: Resolve-DnsName -Name example.com -Type NAPTR. NAPTR records are less commonly queried manually because they're primarily used by automated systems (SIP proxies, ENUM resolvers). To understand the complete resolution process, you may need to follow the chain: NAPTR → SRV → A/AAAA records.
Related Record Types
Frequently Asked Questions
What is a DNS NAPTR record?
A DNS NAPTR (Naming Authority Pointer) record provides rewrite rules for mapping domain names to URIs or other services. It is commonly used in ENUM (mapping phone numbers to internet services), SIP (VoIP call routing), and other systems that need to translate between different naming schemes.
What is ENUM and how does it use NAPTR?
ENUM (E.164 Number Mapping) uses NAPTR records to map telephone numbers to internet services. A phone number is reversed, dotted, and placed under the e164.arpa domain. NAPTR records at that domain specify how to reach the number's owner via SIP, email, web, and other services.
What do the NAPTR flags mean?
NAPTR flags indicate what to do with the result: 'u' means the output is a terminal URI (no further lookups needed), 's' means look up an SRV record using the replacement field, 'a' means look up an A or AAAA record, and empty flags mean process another NAPTR record using the replacement field.
How does NAPTR order and preference work?
Order determines the sequence in which NAPTR records are processed (lower values first). Among records with the same order value, preference determines which to try first (lower values preferred). This two-level priority system allows for flexible routing with fallback options.
Are NAPTR records commonly used?
NAPTR records are less common than A, CNAME, or MX records, but they are essential in VoIP/SIP, ENUM, and enterprise telecom environments. Most regular websites don't need NAPTR records. They are primarily used by specialized applications that need dynamic service discovery and URI rewriting.