Database Servers to run optimally |
|
Legend: Red : Contents need to be entered into the file Orange : Commands
This guide assumes that your nameservers already have authority over the IP or IP range that you are creating PTR’s (rDNS) for. If you are not sure, you can check using the dig command:
dig 123.456.789.123.in-addr.arpa. ns
The order of the octets is opposite of the normal IP. For example, if you are checking the IP 205.134.252.71, your command will be:
dig 71.252.134.205.in-addr.arpa. ns
If your nameservers do not have authority over the IP(s), you cannot create PTRs for them. You will either need to have the owner of the IP do so, or have then delegate authority to your nameservers.
Also going without saying, I’m assuming here that your nameservers are running BIND, whether they have cPanel or not.
Edit your /etc/named.conf file to include an entry for your reverse zone. I’m going to use the 4.66.117.0/24 block as an example. So, the entry will look like this:
zone “117.66.4.in-addr.arpa” {
type master;
file “/var/named/4.66.117.rev”;
};
Note that the first line is the IP in reverse format. Also, you are using anything but a full 255 range of IPs you will need to specify this in the arpa line. For example:
zone “96-127.7.66.4.in-addr.arpa” {
Next, create a .rev file under the db file you specified for the records. In this case it is /var/named/4.66.117.rev.
vi /var/named/4.66.117.rev
This is your actual zone file, and the first part of it will appear just like the ones for your domains:
;authoritative data for 117.66.4.in-addr.arpa
@ IN SOA ns1.yournameserver.com. root.your.emailaddress. (
2007110801 ;serial number YYYYMMDDxx
10800 ;refresh time in seconds
3600 ;retry time in seconds
604800 ;time in seconds
86400 ) ;minimum time to live in seconds
IN NS ns1.yournameserver.com.
IN NS ns2.yournameserver.com.
Below this, you will have all your PTR’s listed under the last octet of each IP. For instance, to do a PTR for 4.66.117.10 - 4.66.117.14 you would put:
10 IN PTR hostname.com.
11 IN PTR hostname1.com.
12 IN PTR hostname2.com.
13 IN PTR hostname3.com.
14 IN PTR hostname4.com.
It’s important to remember that you should not have the same IP pointed to two different hostnames, and that each line be finished by a period at the end of the hostname.
When you’ve created your PTR’s, simply reload named on the nameserver. Don’t use the zone synchronization from WHM, as that will create an empty .db file and cause your PTR’s not to work.
Reverse DNS can take a few hours to propagate sometimes, but you can check by using the host or dig commands:
host 4.66.117.10
or
dig -x 4.66.117.10
|