Skip to content
Log In Sign Up info@muvcloud.com

Forward and Reverse Lookups

A normal, forward lookup turns a name into an address with an A or AAAA record. A reverse lookup goes the other way: it turns an address into a name with a PTR record. The two are separate records in separate zones, and one does not create the other.

How a PTR Record Is Stored

Reverse names are the address written backward under a special domain. For IPv4 that is in-addr.arpa:

10.113.0.203.in-addr.arpa.  3600  IN  PTR  mail.example.com.

This record says that 203.0.113.10 belongs to mail.example.com. IPv6 uses ip6.arpa, with every hexadecimal digit of the full address reversed and separated by dots, which is why those names are long. Other record types are covered in DNS record types explained.

Who Sets It

The reverse zone belongs to whoever controls the IP address block, not to the owner of the domain. For a server's public address, that is your hosting provider. Providers usually let you set the PTR name for your addresses in their control panel, or do it on request. Adding a PTR record to your own domain's zone has no effect.

Look It Up

dig -x 203.0.113.10 +short
host 203.0.113.10
nslookup 203.0.113.10

All three return the PTR name, if one exists. dig also shows the TTL and status; see the dig command. An empty answer or NXDOMAIN means no PTR record is set.

Forward-Confirmed Reverse DNS

A PTR record alone proves little, because the IP's controller can enter any name. Forward-confirmed reverse DNS (FCrDNS) adds a check in the other direction:

  1. Look up the PTR name of the address: dig -x 203.0.113.10 +short returns mail.example.com.
  2. Look up that name's address: dig +short mail.example.com A.
  3. If the result includes 203.0.113.10, the two match and the address is forward-confirmed.

So create the A record for the name first, then set the PTR record to that name.

Why Mail Servers Check It

Receiving mail servers use reverse DNS as a quick first filter. Many reject or heavily score mail from an address with no PTR record, from a PTR name that does not resolve back to the address, or from a generic name that looks like a home connection. The published sender guidelines of some large mailbox providers require valid forward and reverse DNS from every sender. For a server that sends mail:

  • Use a name in your own domain: such as mail.example.com.
  • Match the HELO name: the name the mail server announces should be the same as the PTR name.
  • Match the host name: set the server's host name to the same name; see how to change the hostname in Ubuntu.
  • Add SPF, DKIM, and DMARC: reverse DNS is one check among several.

Sending mail from a server is covered in how to send email from the Linux command line.

Other Uses

traceroute and mtr show PTR names for each hop, which often reveal a router's location or carrier. Some services log client names from reverse lookups; the SSH server does so only when UseDNS is turned on, which is not the default. Some services refuse connections from addresses without reverse DNS.

Troubleshooting

  • Old name still shown: resolvers cache the PTR record for its TTL. Ask the authoritative server or wait.
  • Change not possible: some providers only accept a PTR name whose A record already points to the address.
  • IPv6 mail rejected: if the server sends over IPv6, its IPv6 address needs its own PTR record too.

Updated:

Linux VPS with Full Root Access

MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.

Cloud VPS Plans Starting at2.99 $/mo Cheap Linux VPS

No Limits on Service or Support

You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

Support specialist
  • 100% customer satisfaction goal
  • Our own hardware
  • 24/7 ticket and email support
  • 4 countries with locations