How do you add a reverse dns entry using cpanel?

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
Go on, have a guess
Well, if they've delegated it down to you, you can. You have to setup an in-addr.arpa zone for the IP address and then create a PTR address for the IP in that zone. It can all be done through WHM, but it's a bit tricky.
 

zentity

Well-Known Member
Jun 16, 2004
78
0
156
An example, its not that hard if you have command line access, you can do it with whm I guess if you follow this example as a guide.

Say you IP you want to set up reverse for is 123.124.125.126

OK,

vi /var/named/125.124.123.in-addr.arpa

Enter:

$ORIGIN 125.124.123.in-addr.arpa.
$TTL 86400
@ IN SOA ns1.nameserver.com. email.nameserver.com. (
2004071301 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS ns1.nameserver.com.
126 IN PTR some.server.com.

now if you wanted to also add the PTR for 123.124.125.127 - You would simply add 127 to the same dns zone

$ORIGIN 125.124.123.in-addr.arpa.
$TTL 86400
@ IN SOA ns1.nameserver.com. email.nameserver.com. (
2004071301 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS ns1.nameserver.com.
126 IN PTR some.server.com.
127 IN PTR someother.server.com.

The add to /etc/named.conf

zone "125.124.123.in-addr.arpa" in {
type master ;
file "/var/named/125.124.123.in-addr.arpa" ;
} ;

rndc reload or restart named - Thats if the IP is delegated to you, which most providers don't do - buts thats how it could be done. :)