Page 1 of 1

Correct PTR records

Posted: Sun Jan 27, 2013 5:46 pm
by faris
I'm really annoyed with myself. I thought I knew all about DNS inside out. But suddently I've found something that I know was correct and simple and straightforward but now I'm not at all sure of.

All our Plesk servers are configured so that only one domain per IP has a PTR record in its DNS record. That way you don't get the mad random domain in email headers.

I've just noticed that I've been setting said PTR records like this:

123.123.123.123/24 PTR main-domain.tld
where 123.123.123.123 is the IP for main-domain.tld (and is the first IP on the server and therefore the IP it connects to the outside world on).

It's that /24 that's bothering me. /24 is not the subnet that 123.123.123.123 is part of - our IP allocation is smaller than 256. And why am I specifying a subnet at all?

So as you see, it seems I've lost the plot.

How is it really meant to be set? Can someone please "point" me in the right direction please, if you'll excuse the pun?

I feel so very stupid asking this very basic question in public, but if I don't ask then I'll never learn the correct answer.

Re: Correct PTR records

Posted: Sun Jan 27, 2013 6:42 pm
by breun
PTR records are handled by the party handling the IP addresses. When you rent a server from a server provider that's usually not you, but the server provider. They might allow you to set the PTR records for your IP addresses through a control panel or you might have to ask them via e-mail, but usually this means your server isn't the place where these PTR records should be and you can delete them from all of your zones (and don't forget your DNS templates for any future domains).

Re: Correct PTR records

Posted: Mon Jan 28, 2013 7:54 am
by faris
Ah! I remember having a similar conversation with you on this before.

Yes, the actual rDNS entries that the internet at large looks up are handled by our co-lo company's DNS servers. But because we have 127.0.0.1 as the first entry in resolv.conf, these are almost never used when our own systems do lookups. And we don't want to use something other than 127.0.0.1 as the first entry in resolve.conf.

Now, having said all that, the niggle/problem that surrounded PTR records in Plesk was that the out-of-the-box DNS template put a PTR record in every domain's DNS record. And this caused a random hosted domain to be shown in received email headers rather than the actual system hostname. The solution suggested at the time (many years ago) was to remove all PTR records other than the one in your hostnames's DNS records. And this certainly works. Or worked.

Thinking about it, I'll bet the default was xxx.xxx.xxx.xxx/24 which is where the /24 came from, which I never changed and never thought about.

Reading between the lines, the subnet specified should be your real subnet, not /24.

But as far as I can tell, using /24 in the plesk panel DNS does create a valid in.arpa file, with a PTR record for each dedicated IP contained within it.

e.g. for PTR records added via Plesk like this: 123.123.123.111/24 hostname.tld
and 123.123.123.222/24 second-dedicated-up-domain.tld
You end up with a file:

123.123.123.in-addr.arpa

containing:

Code: Select all

; *** This file is automatically generated by Plesk ***
$TTL    86400

@       IN      SOA     hostname.tld. support.hostname.tpd. (
                        1348472437      ; Serial
                        10800   ; Refresh
                        3600    ; Retry
                        604800  ; Expire
                        10800 ) ; Minimum

                 IN NS   hostname.tld.
111              IN PTR  hostname.tld.
222              IN PTR  second-dedicated-ip-domain.tld.


Re: Correct PTR records

Posted: Mon Jan 28, 2013 8:06 am
by breun
faris wrote:Yes, the actual rDNS entries that the internet at large looks up are handled by our co-lo company's DNS servers. But because we have 127.0.0.1 as the first entry in resolv.conf, these are almost never used when our own systems do lookups. And we don't want to use something other than 127.0.0.1 as the first entry in resolve.conf.
No problem, that's what we do as well.
faris wrote:Now, having said all that, the niggle/problem that surrounded PTR records in Plesk was that the out-of-the-box DNS template put a PTR record in every domain's DNS record. And this caused a random hosted domain to be shown in received email headers rather than the actual system hostname. The solution suggested at the time (many years ago) was to remove all PTR records other than the one in your hostnames's DNS records. And this certainly works. Or worked.
There is no need to keep the PTR record for your hostname on your server. If your colo handles the PTR records, just remove all PTR records from your Plesk server's nameserver. DNS will take care of correctly reversing your IP addresses.

Re: Correct PTR records

Posted: Mon Jan 28, 2013 1:46 pm
by faris
That's ideal. I did not realise that would happen. You are always educating me :-)