[DNS] PTR Record to all my Domains.

IPaddress

Verified User
Joined
Feb 21, 2004
Messages
86
Hi.
Im running Directadmin 1.33.7 on a CentOS 5 Final with BIND 9.2.4
How can i add a PTR record to all the domain in my server?
I have arround 500 Domains so its going to be really annoying if i have to do it one by one.

Thanks in advance.
Bye!

PD: Sorry for my poor English.
 
Why would you need ptr records for domains.

PTR records are for ip -> hostname.
 
Yeap, however i've read that some (the minority) EMail server are starting to Blacklist Domains without a PTR Record. So i've decide to add it in all my domains.

Bye.
 
You only add one for the ip that listens on port 25 for incoming mail and only for the server hostname or hostname that serves the email. It does not have to be for every single domain.
 
And just to re-empasize, the PTR record would be for the ip address and it would be for the sending ip address not the listening ip address (unless they are the same). You can have many ip addressing listening for mail but usually only one that sends mail.

The PTR record should match the A record of the hostname of the machine. This does not have anything to do with virtual domains hosted on that machine.

A record = host.example.com. IN A 1.2.3.4
PTR record = 1.2.3.4 IN PTR host.example.com.

The 1.2.3.4 is the ip that mail goes out on whether that is the main ip or another one specified in the exim.conf file.

Any virtual domains are not relevant.
 
Last edited:
And ... don't forget that setting your own rDNS (reverse DNS, PTR record) is worthless unless your upstream (whoever assigned you the IP#s) has delegated the authority to your nameservers. Otherwise they need to set it. Generally (though not always) upstream providers will only delegated authority if you've got at least a /24 network.

Note: having more than one PTR record for one IP# is not defined in the RFCs; even resolvers (what computers use to find your DNS) can break when they get multiple records returned even if they're fully RFC compliant. It's certainly NOT recommended if you want your DNS to just work.

And yet one more note: even if you do create a PTR record for each domain it's unlikely an IP# will ever match up with the domain the resolver is expecting, since generally even the best-behaved resolvers will only return a few of the replies, and your nameserver will use a different random order each time it sends a response to a PTR request.

Jeff
 
Sorry to drag up an old topic but this was relevant and I wanted to get some questions I had confirmed/clarified:
The PTR record should match the A record of the hostname of the machine.
Does it have to match the hostname and if so, is it also necessary to set up DNS for nameservers etc or is just the A record sufficient?

I'm a clutz with DNS and had nothing to do with the setting up of the server or DNS initially and I'm now trying to get our email situation sorted out. To cut a long and complicated story short, we need our PTR to be associated with a different domain than our primary/main domain. I set up a new domain and the A record with my registrar. Our IP provider added a PTR for that domain name, but our main domain is the one associated with the hostname (server.maindomain.com).

Do we need to change the hostname for the server to the new domain name (server.newdomain.com) and do we just do that through DA admin settings and reboot or does it require the editing of a file?

Do I need to add NS/MX records with my registrar for the new domain name?
(The domain name isn't associated with any site, though a sub domain may be set up in the future)

If I've read other topics correctly, we don't need a user level account set up for the new domain if it's just there to act as a (type of) hostname?

Thanks for your help!
 
Last edited:
The ptr of the ip only has to match the host the mail server is replying as.

You can tell that by:

telnet ip 25

It will show you what the hostname is when it sends the first reply.
 
The ptr of the ip only has to match the host the mail server is replying as.
We were informed we'd only need to have a PTR set using the name of the new domain name (and IP of course) but the new domain name isn't related to the hostname at all.

The current hostname is (eg) server.domain1.com.

domain1.com is a working site but emails from comcast etc get returned to us because rDNS is inconsistent or fails.

We set up a whole new domain name (eg, domain2.com) with appropriate A record and the PTR was set based on that domain name and the IP. However it now appears that in order for the PTR to work for us we need to change the hostname to be domain2.com. The IP of both domain1 and domain2 are the same.

So to change the hostname, is it just a case of doing that through the DA interface, do we need to edit files - or both? During that change and aside from the reboot, would there be much of an interruption to the existing site and it's set up in DA?
 
Last edited:
The only service that cares about the contents of rDNS is mail. While RFCs don't care what the rDNS says, many server administrators assign penalties to servers where the rDNS doesn't match the name of the sending mail server. Unless you've changed the default exim.conf configuration, DirectAdmin's exim configuration sends email as the hostname. That's why you should use the hostname.

(And incidentally, that's also why you shouldn't use different names to send email; why you should always use the hostname, since you can only have one rDNS record.)

(Yes, you can put in more than one rDNS record if you host your own rDNS, but it's against the RFCs, and the result is unspecified; your system may return more than one, but the resolver doing the query could either return more than one (in which case the program asking the resolver may crash, or accept the first one, or accept one at random), or the first one, or none at all. Since it's not defined in any RFC, there's no telling what a program will eventually get.)

You should be able to change your hostname just through the DirectAdmin interface. It may leave some unused files on the server, but they shouldn't cause problems. I have no idea what it might interrupt or with what it may interfere, because I have no idea what you've made dependent on the hostname. (For example, some of us send hostname information in our welcome emails.)

Jeff
 
Back
Top