# NAPTR record

A NAPTR (naming authority pointer) record holds a rule for turning one string into another: a phone number into a SIP address (ENUM), or a domain into the right SRV record for a protocol. Phone systems and mobile networks are the main users.

- Record type: NAPTR
- Type number: 35
- Used for: Services
- How common: Specialist
- Defined in: RFC 3403, RFC 6116

## Format

```
<name> <ttl> IN NAPTR <order> <preference> "<flags>" "<service>" "<regexp>" <replacement>
```

| Field | What it means | Accepted values |
| --- | --- | --- |
| Order | Rules are processed lowest first. | 0 to 65535. |
| Preference | Among equal orders, lower is preferred. | 0 to 65535. |
| Flags | What to do next: S (look up SRV), A (look up an address), U (the result is a URI), P (protocol-specific), or empty (another NAPTR). | `"S"`, `"A"`, `"U"`, `"P"`, `""` |
| Service | The service and protocol. | Such as `"E2U+sip"` or `"SIP+D2T"`. |
| Regexp | A substitution applied to the input, for U rules. | `"!^.*$!sip:info@example.com!"`, or empty. |
| Replacement | The next name to look up, for S and A rules. `.` when the regexp is used. | A host name or `.`. |

## Examples

### SIP over TCP

```
example.com. 3600 IN NAPTR 10 100 "S" "SIP+D2T" "" _sip._tcp.example.com.
```

SIP clients learn to use TCP and look up the SRV record.

### ENUM phone number

```
4.3.2.1.5.5.5.0.0.8.1.e164.arpa. 3600 IN NAPTR 100 10 "U" "E2U+sip" "!^.*$!sip:info@example.com!" .
```

+1 800 555 1234 maps to a SIP address.

## TTL

3600.

## Common mistakes

- Quoting the replacement or leaving the flags unquoted.
- Using both a regexp and a replacement in one rule; only one applies.

## At your DNS host

- Cloudflare, Route 53 and Google Cloud DNS support NAPTR. Most registrar panels don't.

## Questions

### Do I need NAPTR records?

Only if a VoIP or telecom provider asks for them. Websites and email never use them.

## Related

- [SRV record](https://lemon.domains/dns-records/srv.md)
- [URI record](https://lemon.domains/dns-records/uri.md)

Interactive version with a record checker and live lookup: https://lemon.domains/dns-records/naptr
