How to know if reverse PTR record is correct for emailing purposes

digemailptr-recordreverse-dns

I send emails for test@example.com with my own server. When using dig -x xxx.xxx.xxx.xxx with the IP of my server, I get:

;; QUESTION SECTION:
;xxx.xxx.xxx.xxx.in-addr.arpa.     IN      PTR

;; ANSWER SECTION:
xxx.xxx.xxx.xxx.in-addr.arpa. 86399 IN     PTR     ns328xxxx.ip-xxx-xxx-xxx.eu.

How to know if this answer is correct for email purposes?

Should example.com appear in the answer instead? Or is ns328xxxx.ip-xxx-xxx-xxx.eu correct? (x are replaced by numbers).

Note: this question is different to this one, thus the two questions.

Best Answer

It doesn't actually really matter what the name in reverse DNS is, as long as the use of names is consistent.

Arguably, as long as there is "forward confirmation" (there exist A/AAAA records that agree with the reverse DNS PTR), the reverse DNS in itself is "correctly set up".

Then there's the matter of what the hostname / "mailname" of the mail server host is set to. Ie, the name that a mailserver uses to refer to itself in the SMTP dialog.
This is expected to match the declared hostname according to reverse DNS, and some, but not all, services out there will care if these differ.

What does not matter is if the hostname of your mailserver has any relation to the domain names it handles mail for.
It's a fairly widespread misconception that these names should match, but them matching would actually be very strange for several reasons:

  • Many mail servers handle mail for several domains, but they can just have one hostname, so they can't possibly match all.
  • A hostname is expected to be something like zeus.example.com while the domain name it handles mail for, even with just a single domain name, would almost certainly be something like example.com. Certainly no match there either, even if there is sometimes a relation between the names for smaller-scale deployments.

There are of course many other aspects regarding what will cause other mail services out there to accept/reject your email, but these are the basics specific to reverse DNS.

Related Topic