↑ ↓ select, Enter open, Esc close

Verify reverse DNS of a mail server IP (FCrDNS)

Adjust the values, the command updates live
user@server
ptr=$(dig +short -x 203.0.113.10 | head -n 1); echo "PTR: $ptr"; dig +short "$ptr" A

Looks up the PTR hostname of the IP and then queries its A record. Only if the original IP appears there is the reverse DNS entry considered confirmed, which many mail servers require. Ideally the hostname also matches the HELO name of the mail server.

Note: For IPv6 addresses, query AAAA instead of A at the end.

Also searched as

  • check fcrdns
  • reverse dns does not match hostname
  • emails rejected because of ptr

Related one-liners

All in DNS

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.