Server Administration & Management

How to setup rDNS in cPanel

I’ve seen so many people say on there that you MUST contact the data center for each rDNS entry you need. This is totally false and untrue in most cases. Most data centers can add your nameservers, and their ips to have access to reverse the address yourself. This can be done WITH or WITHOUT cPanel. You must email the data center and have them authorize your name servers for reverse access before you attempt this.

Some information to start with: Occets

An IPv4 IP address is sparated into 4 occets each separated by a period. So 12.21.31.xxx being our ip, 12 is the first occet, 21 is the second, and so on and so fourth.

Ok now to the rDNS with cPanel.

1. First you must create a in-addr.arpa zone. Goto dns functions and click add a dns zone.

2. Now this is where you use the occet knowledge. You have an IP block from your dedicated provider.

3. For this article we will use 12.21.31.xxx. You will most likely want to choose system or root to manage this domain as you probably don’t want your customers messing with rDNS.

4. In the IP Box we will type the main IP Address for accessing the server.

5. In the domain box we will type: 31.21.12.in-addr.arpa

6. Notice that the numbers are still read forward but the fourth occet has been dropped and third occet has been placed first, second occet in the middle, and first occet in the end. This is very important for rDNS to work right.

7. Now click submit.

8. You now have your PTR zone. It should have your ns1.* and ns2.* name servers listed. As well as a mx entry.

9. Now were ready to actually reverse the ip address. This is where the fourth occet of the ip will be picked back up. For the rest of the tutorial we’ll assume our ips are (Yes I know these aren’t real ips as the last occet number is wrong this is to not disturb any ISPs)

10. Go to the bottom of your edit dns for this zone.

11. Enter your fourth occet of the ips you wish to reverse in the first box in each row in the bottom section of this page. For this tutorial this is 001, 002, 003.

12. Switch the drop down for each one to PTR.

13. Enter what you wish to reverse in the box just to the right of the drop down we selected PTR in. We’ll use ssh.mydomain.com, ns1.mydomain.com and ns2.mydomain.com for this.

Each address must end in a period such as:

14. This period is important as it tells this zone this is the end of what were reversing, and causes BIND to not add the zone file name onto the end.

So now what we have in first three rows at the bottom of page should look like this.

001 14400 IN PTR ssh.mydomain.com.
002 14400 IN PTR ns1.mydomain.com.
003 14400 IN PTR ns2.mydomain.com.

Now click save. And your done. You’ve just set up three ips for reverse dns. Remember to be patient. It can take a bit for the reverse entry to traverse the world. So it doesn’t always resolve immediately, tho most hosts only take a couple seconds.

March 2, 2011 Posted by | cPanel, DNS | , , | 2 Comments