# PTR record

A PTR (pointer) record maps an IP address back to a name, the opposite of an A record. It's called reverse DNS. Mail servers check it: email from an address with no PTR, or a PTR that doesn't match, is often treated as spam. PTR records are set by whoever owns the IP address, usually your hosting company, not in your domain's DNS.

- Record type: PTR
- Type number: 12
- Used for: Services
- How common: Common
- Defined in: RFC 1035

## Format

```
<reversed address>.in-addr.arpa. <ttl> IN PTR <host name>
```

| Field | What it means | Accepted values |
| --- | --- | --- |
| Name | The IP address, reversed, under in-addr.arpa (IPv4) or ip6.arpa (IPv6, one hex digit per label). | 192.0.2.25 becomes `25.2.0.192.in-addr.arpa.` |
| Host name | The name the address should report. | A full host name, which should have an A or AAAA record pointing back to the same address. |

## Examples

### IPv4 mail server

```
25.2.0.192.in-addr.arpa. 3600 IN PTR mail.example.com.
```

Paired with mail.example.com A 192.0.2.25: forward and reverse match, which mail receivers like.

### IPv6

```
1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa. 3600 IN PTR mail.example.com.
```

Every hex digit of 2001:db8::1, reversed.

## TTL

3600 to 86400.

## Common mistakes

- Trying to add a PTR in your domain's DNS. It goes in the reverse zone, run by the owner of the IP address. Set it in your host's control panel (often called Reverse DNS or rDNS), or ask your provider.
- A PTR that points to a name whose A record doesn't point back (no forward-confirmed reverse DNS).
- Generic PTRs such as 192-0-2-25.static.provider.net on a mail server. Set it to your mail host's name.

## At your DNS host

- Hetzner, DigitalOcean, AWS (Elastic IP), Linode and most VPS hosts have a Reverse DNS setting per IP. Home connections usually can't change it.

## Questions

### What is reverse DNS?

Looking up the name for an IP address, using PTR records. It's mainly used by mail servers and logs.

### Why can't I add a PTR record at my DNS host?

Reverse records belong to the IP address's owner. Your hosting provider controls them; set it in their panel.

## Related

- [A record](https://lemon.domains/dns-records/a.md)
- [AAAA record](https://lemon.domains/dns-records/aaaa.md)
- [MX record](https://lemon.domains/dns-records/mx.md)
- [SPF record](https://lemon.domains/dns-records/spf.md)

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