How to Configure Reverse DNS for BIND in WHM


Last modified: August 28, 2019

Overview

Reverse DNS uses pointer records (PTR) to convert IP addresses to domain names. Forward DNS uses A records to convert domain names to IP addresses.

Use the steps in this document to determine your server’s authoritative nameservers. If your cPanel & WHM server is authoritative, you can set PTR records on it. In general, most cPanel & WHM users do not have the authority to directly edit their PTR record. Instead, some providers offer reverse DNS management in a client interface. Alternatively, you should contact your network provider.

Important:
  • Changes to your server’s DNS nameservers do not take effect if your server’s DNS nameservers are not authoritative for your IP address. Many hosting providers do not delegate authority for PTR records to their customers.

  • Contact your network provider to either delegate authority to your nameservers or set up PTR records for your nameservers.

Configure reverse DNS

PTR records require authoritative DNS nameservers before they can function properly.

To find the authoritative DNS nameservers of your server’s main IP address, trace the Start Of Authority (SOA). To do this, run the appropriate command:

dig +nssearch 0.168.192.in-addr.arpa

Note:
  • In this example, 0.168.192.in-addr.arpa represents your server's main IP address.
  • WHM's Add a DNS Zone interface (WHM >> Home >> DNS Functions >> Add a DNS Zone) does not currently support IPv6.
Remember:
  • Changes to your server’s DNS nameservers do not take effect if your server’s DNS nameservers are not authoritative for your IP address. Many hosting providers do not delegate authority for PTR records to their customers.

  • Contact your upstream provider to either delegate authority to your nameservers or set up PTR records for your nameservers.


Navigate to WHM's Add a DNS Zone interface (WHM >> Home >> DNS Functions >> Add a DNS Zone) and enter the following information:

  • Enter your server’s IP address in the Ipv4 Address text box.

  • Enter reverse DNS zone’s name in the Domain text box.

    • To create a reverse DNS zone name for an IPv4 address, perform the following steps:
    1. Drop the last octet from the IP address.

    2. Reverse the order of the octets that remain.

    3. Append in-addr.arpa to the end of the octets.

A complete reverse DNS zone name for an IPv4 address will resemble the following example:

128/24.0.168.192.in-addr.arpa
Note:
If your hosting provider delegates you a byte boundary that is greater than 25, separate the network range and byte boundary with a dash (), rather than a forward slash (/). For example:
128-25.0.168.192.in-addr.arpa
For more information, read the RFC 2317 documentation.

After you create your zone file, create each PTR record in WHM's Edit DNS Zone interface (WHM >> Home >> DNS Functions >> Edit DNS Zone).

Note:
Your zone file already contains an NS entry for each of your server’s authoritative nameservers.
  1. Enter the octets in an available text box under the Add New Entries Below this Line heading.

  2. Select PTR in the appropriate menu. The Hostname text box will appear.

  3. Enter the hostname that corresponds to the last octet in the IP address.


After your domain’s DNS information propagates, confirm that you properly configured reverse DNS.

To confirm that you properly configured reverse DNS, run the following command:

host 192.168.0.1

If you correctly configured reverse DNS, the output will resemble the following example:

1.0.168.192.in-addr.arpa domain name pointer www.example.com.


Additional Documentation