Correct PTR records

General Discussion of atomic repo and development projects.

Ask for help here with anything else not covered by other forums.
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Correct PTR records

Unread post 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.
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: Correct PTR records

Unread post 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).
Lemonbit Internet Dedicated Server Management
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Re: Correct PTR records

Unread post 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.

--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: Correct PTR records

Unread post 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.
Lemonbit Internet Dedicated Server Management
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Re: Correct PTR records

Unread post by faris »

That's ideal. I did not realise that would happen. You are always educating me :-)
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
Post Reply