HTTPfy

NAPTR record

A NAPTR (Naming Authority Pointer) record holds a rewrite rule. VoIP uses it to choose a transport for SIP, and ENUM uses it to turn phone numbers into URIs.

Live NAPTR records from real domains

Checked at via public DNS
sip2sip.infoNAPTR
sip2sip.info. 300 IN NAPTR 5 100 "s" "SIPS+D2T" "" _sips._tcp.sip2sip.info.
  ; order 5, pref 100: SIP over TLS/TCP, then look up SRV _sips._tcp.sip2sip.info
sip2sip.info. 300 IN NAPTR 10 100 "s" "SIP+D2T" "" _sip._tcp.sip2sip.info.
  ; order 10, pref 100: SIP over TCP, then look up SRV _sip._tcp.sip2sip.info
sip2sip.info. 300 IN NAPTR 20 100 "s" "SIP+D2U" "" _sip._udp.sip2sip.info.
  ; order 20, pref 100: SIP over UDP, then look up SRV _sip._udp.sip2sip.info
sip.linphone.orgNAPTR
sip.linphone.org. 10800 IN NAPTR 10 100 "s" "SIPS+D2T" "" _sips._tcp.sip.linphone.org.
  ; order 10, pref 100: SIP over TLS/TCP, then look up SRV _sips._tcp.sip.linphone.org
sip.linphone.org. 10800 IN NAPTR 20 100 "s" "SIP+D2T" "" _sip._tcp.sip.linphone.org.
  ; order 20, pref 100: SIP over TCP, then look up SRV _sip._tcp.sip.linphone.org
sip.linphone.org. 10800 IN NAPTR 30 100 "s" "SIP+D2U" "" _sip._udp.sip.linphone.org.
  ; order 30, pref 100: SIP over UDP, then look up SRV _sip._udp.sip.linphone.org
sip.antisip.comNAPTR
sip.antisip.com. 3600 IN NAPTR 50 50 "S" "SIPS+D2T" "" _sips._tcp.sip.antisip.com.
  ; order 50, pref 50: SIP over TLS/TCP, then look up SRV _sips._tcp.sip.antisip.com
sip.antisip.com. 3600 IN NAPTR 60 50 "S" "SIP+D2T" "" _sip._tcp.sip.antisip.com.
  ; order 60, pref 50: SIP over TCP, then look up SRV _sip._tcp.sip.antisip.com
sip.antisip.com. 3600 IN NAPTR 100 50 "S" "SIP+D2U" "" _sip._udp.sip.antisip.com.
  ; order 100, pref 50: SIP over UDP, then look up SRV _sip._udp.sip.antisip.com
4.4.2.2.3.3.5.6.8.1.4.4.e164.arpaNAPTR
4.4.2.2.3.3.5.6.8.1.4.4.e164.arpa. 86400 IN NAPTR 100 10 "u" "E2U+sip" "!^\\+441865332(.*)$!sip:\\[email protected]!" .
  ; order 100, pref 10: ENUM to SIP URI, the regexp produces the final URI
4.4.2.2.3.3.5.6.8.1.4.4.e164.arpa. 86400 IN NAPTR 100 20 "u" "E2U+pstn:tel" "!^(.*)$!tel:\\1!" .
  ; order 100, pref 20: E2U+pstn:tel, the regexp produces the final URI

What the NAPTR record does

In SIP (RFC 3263), a client resolving sip:[email protected] queries NAPTR at example.com. Each record offers a transport (SIPS+D2T = SIP over TLS over TCP, SIP+D2U = UDP, SIP+D2T = TCP) and, with flag s, an SRV name to query next. The client picks the lowest order, then the lowest preference, among the transports it supports.

In ENUM, a phone number such as +44 1865 332244 is reversed digit by digit under e164.arpa. The NAPTR there applies a regular expression to the number to produce a sip: or tel: URI (flag u).

Zone-file syntax

example.com.  3600  IN  NAPTR  10 100 "s" "SIPS+D2T" "" _sips._tcp.example.com.
; order pref flags service regexp replacement

Wire format: RDATA is order and preference (16-bit each), flags, services and regexp (character-strings), and a replacement domain name.

Fields

FieldMeaning
OrderLower is processed first; records with a higher order are only used if lower ones fail.
PreferenceTie-break among equal order.
Flagss next lookup is SRV, a next is A/AAAA, u result is a URI, empty means another NAPTR lookup.
ServicesApplication-specific, e.g. SIP+D2U, E2U+sip.
Regexp / ReplacementEither a substitution expression or a replacement name; exactly one is used, the other is empty or ..

Common mistakes

  • Filling in both regexp and replacement.
  • Escaping in the regexp field: backslashes must be doubled in zone files.
  • Advertising a transport (TLS) in NAPTR that has no matching SRV record.

Specification

  • RFC 3403: Dynamic Delegation Discovery System (DDDS) Part Three: The DNS Database
  • RFC 3263: SIP: Locating SIP Servers
  • RFC 6116: The E.164 to URI DDDS Application (ENUM)

Related record types

  • SRV: host and port for a named service
  • URI: map a service name to a full URI
  • SVCB: generic service binding for any protocol

All DNS record types