A NAPTR record (Naming Authority Pointer) is a DNS resource record that stores a rewrite rule, allowing a resolver to transform a domain name or other identifier into a new domain name or a URI. Among the DNS records used on the Internet, it is one of the most flexible, because it lets an application discover which services and protocols are available for a name and how to reach them.
NAPTR is defined in the Dynamic Delegation Discovery System (DDDS) specifications, chiefly RFC 3403, and it is the foundation of ENUM telephone-number mapping, SIP server location and several identifier-resolution schemes. It rarely works alone: a typical lookup chain passes from NAPTR to an SRV record and then to an A record or AAAA record.
How a NAPTR record rewrites names
A NAPTR record works by applying an ordered set of rules to an input string and returning either a new domain name to query or a final URI. The client sorts all NAPTR records for a name, evaluates them in sequence, and follows the first rule that matches its needs. This makes NAPTR an engine for delegation and service selection, not a simple pointer like a CNAME.
Each record carries six fields after the owner name. Two fields control ordering, one controls whether the lookup ends, one names the service, and the last two carry the actual rewrite, either as a regular expression or as a replacement domain name. Exactly one of the regexp and replacement fields may be used in a given record.
The table below lists the fields in a NAPTR record and the role each one plays during resolution.
| Field | Content | Role in resolution |
|---|---|---|
| Order | 16-bit integer | Rules with lower values are processed first and strictly |
| Preference | 16-bit integer | Ranks records with equal order; a soft preference |
| Flags | String such as S, A, U or P | Signals whether the lookup is terminal and what comes next |
| Service | String such as E2U+sip or SIP+D2U | Names the protocol or application the rule serves |
| Regexp | Substitution expression | Rewrites the input string into a URI or name |
| Replacement | Fully qualified domain name | Gives the next name to query when no regexp is used |
In zone file syntax, a record for SIP over UDP may look like example.com. IN NAPTR 10 50 "S" "SIP+D2U" "" _sip._udp.example.com., which tells a SIP client to look up the named SRV record next.
Flags and the end of the lookup chain
The flags field decides whether resolution continues and which record type the client should request next. An empty flag means the rule is non-terminal, so the output is another domain that holds further NAPTR records. A terminal flag tells the client to leave the NAPTR layer and finish the job with another lookup or with the URI itself.
The following table summarizes the common flags and what a client does after it receives each one.
| Flag | Meaning | Next step for the client |
|---|---|---|
| S | Terminal, output is an SRV owner name | Query SRV records for the replacement name |
| A | Terminal, output is a host name | Query A, AAAA or similar address records |
| U | Terminal, output is a URI | Use the URI produced by the regexp directly |
| P | Protocol-specific processing | Hand control to the application protocol rules |
| Empty | Non-terminal rule | Query NAPTR records for the new domain |
Because non-terminal rules can point to further NAPTR sets, loops are possible in badly built zones. Robust clients therefore limit the number of rewrite steps and stop when a name repeats.
NAPTR in ENUM and SIP service discovery
The best-known use of NAPTR is ENUM, which maps an E.164 telephone number to Internet services. The number is reversed digit by digit, separated with dots and placed under e164.arpa or a private tree, so +44 20 7946 0000 becomes a domain ending in 4.4.e164.arpa. NAPTR records at that name then return URIs such as sip:, tel: or mailto: with the U flag and service values such as E2U+sip.
SIP itself relies on NAPTR to select the transport protocol. A client resolving a SIP domain first queries NAPTR to learn whether the provider prefers TLS over TCP, plain TCP or UDP, then queries the matching SRV record, and finally resolves addresses. This three-stage NAPTR, SRV, address chain is described in RFC 3263.
Other deployments include URN resolution, carrier routing databases in mobile networks, and S-NAPTR (RFC 3958), a simplified profile that drops regular expressions in favor of fixed application service tags.
How NAPTR compares with related DNS records
NAPTR overlaps with several neighboring record types, but it is the only one that performs string rewriting. The comparison below shows where each type fits.
| Record type | What it returns | Typical use |
|---|---|---|
| NAPTR record | Rewrite rule, new name or URI | ENUM, SIP transport choice, URN resolution |
| SRV record | Host, port, priority and weight | Locating a service endpoint for a protocol |
| SVCB record | Service endpoint with parameters | Modern service binding with ALPN hints |
| CNAME | Canonical alias for the whole name | Pointing one host name at another |
| PTR | Host name for a reverse lookup | Mapping an IP address back to a name |
In practice, NAPTR sits one layer above SRV: it chooses which service and protocol to use, while SRV chooses which server and port. SVCB and HTTPS records solve a related problem for web protocols, but they carry parameters rather than regular expressions.
Limitations and common configuration mistakes
NAPTR is powerful but easy to misconfigure, and errors often surface only as silent call failures or fallback to a default transport. Operators should validate records with a resolver tool and test real clients before publishing changes.
| Symptom | Likely cause | Fix |
|---|---|---|
| Client ignores the record | Unknown or misspelled service value | Use the registered service string exactly |
| Regexp produces a broken URI | Wrong delimiter or unescaped characters | Test the expression against sample inputs |
| Lookup never terminates | Non-terminal rules pointing in a circle | Add a terminal flag and remove the loop |
| Wrong transport is chosen | Order and preference values swapped | Give the preferred protocol the lowest order |
| Record rejected at load time | Both regexp and replacement filled | Leave one field empty or set it to a dot |
- Privacy concerns arise in public ENUM, because a telephone number can reveal personal service addresses to anyone who queries it.
- Limited client support outside telephony means general web software rarely reads NAPTR at all.
- Response size grows quickly with many rules, which can push answers beyond UDP limits and force TCP retries.
- DNSSEC signing is advisable, since a forged NAPTR answer can redirect calls to an attacker-controlled endpoint.
Explained without jargon
A NAPTR record is like a set of directions at a reception desk. You arrive with a name or a phone number, and the desk tells you which department handles your request and which door to use. Sometimes it hands you a final address, and sometimes it sends you to another desk for more directions.
Telephone and calling systems use it most. When a call app needs to reach someone, it asks the DNS which ways of talking that person or company supports, then picks the best one. The key idea is translation: one identifier goes in, and a usable destination comes out.
A typical use case
A regional internet telephony provider wants its business customers to reach each other directly over SIP instead of routing calls through the public telephone network. The provider publishes NAPTR records in a private ENUM tree for every customer number. For one office line, the record carries order 100, preference 10, flag U, service E2U+sip and a regexp that turns the number into sip:reception@office.example.
For the SIP domain itself, the provider publishes two more NAPTR records: TLS over TCP at order 10 and UDP at order 20. Phones query the number, receive the SIP URI, look up NAPTR for the domain, choose TLS, follow the SRV record to port 5061 and connect. The result is calls that stay on IP end to end, with encrypted signaling and lower interconnection costs than the conventional telephone route.