Postfix PTR error

Dear Community,

I want to setup a mailserver with a public DNS record. There are already some threads here in the forum, but the most relevant I could find is five years old (Postfix myhostname) and the bug report is closed (

My server admin book is telling me that it is very important, that postconf myhostname will prompt the DNS registered fdqn. In UCS it is the local DNS fdqn - having the internal domain name in it.

The server setup is actually almost working. The only change I have made to ucr registry is changing the helo name to the public DNS record. This way I can send emails to many email-adresses (including, university-servers) - but GMX is telling me:

Feb 16 11:27:54 host postfix/smtp[7004]: 9FD80C8252C: to=<>,[]:25, │2018-02-15 23:44:43,651 fail2ban.filter [5568]: INFO    Set maxRetry = 5
delay=405, delays=404/0.31/0.2/0, dsn=4.0.0, status=deferred (host[] refused to talk to me: 554-g│2018-02-15 23:44:43,658 fail2ban.filter [5568]: INFO    Set findtime = 600 (mxgmx117) Nemesis ESMTP Service not available 554-No SMTP service 554-Bad DNS PTR resource record. 554 For explanation │2018-02-15 23:44:43,659 fail2ban.actions[5568]: INFO    Set banTime = 600

The solution can of course go in different directions:

  • don’t care to change local DNS name in the public sphere
  • changing the myhostname setting in

The question is: what is - for security reasons as well as for system stability - the way I should go? As changing myhostname is not possible through a ucr registry entry. Perhaps telling the world the internal domain-name isn’t a big problem too?

Any thoughts on this are appreciated, kind regards

Edit: the thread poses two questions and a problem (solved) having little to do with the questions - so I will put my questions in a new thread here: Postfix myhostname 4.2

Hi Bernd,

I am unsure about your setup. Where is your server located? What is thee purpose of it?
A mailserver sends and receives emails. If you host your server at home and use an dynamic IP address you can not use this server as a receiving host!

May I assume your server is at home and should only forward your emails?

If you had taken a look at the link GMX provided to you you would have seen:

You need to configure a relay host who accepts your emails and forwards them to the destination. This is usually the SMTP-Server your email-provider told you to use. With the given credentials.

Most email Servers (as GMX and my personal one, too) reject emails directly form dynamical addresse due to spam.


Hi knebb,

that is not the case in my setup as it has public (static) DNS A an MX record. GMX is telling me reasons:

Emails from your email server were rejected because the PTR Resource Record (PTR-RR) of your IP address does not follow our guidelines. Possible reasons for this can be:

  • The PTR-RR states that the IP address was dynamically allocated.
  • The PTR-RR is a generic standard entry of your provider. Please allocate an independent and fully qualified domain name (Fully Qualified Domain Name - FQDN) to your email server and enter the corresponding valid PTR-RR.
  • Individual rejection of the PTR-RR for system protection reasons. Please contact the administrator of your system who should then contact us.

so I would guess it is point no2 that is matching here.
As other big servers are accepting my emails I suppose that GMX is so to say ‘very strict’.

Perhaps there is another DNS subject as the first SMTP Reverse DNS prompt will match something like host.myprovider.xy? But I don’t think so, because all checks are marked as actually OK only Reverse DNS does not match SMTP Banner has a warn sign. And of course: the banner has to be the myhostname…
And in the results for mail.mydomain.xy will have answers from


Yeah, well.

Static IP is not sufficient usually. Most Email servers require as well a valid and matching rDNS entry.

Valid means: IP can reverse resolved to a valid hostname (and not “no such entry”)
Matching means: The resolved entry should match the hostname given by the connecting mailserver.

Use dig to verify your rDNS entry:
dig -x 1.your.ip.address

The entry here should match your postfix hostname. And no, do not change the postfix hostname to the result of the dig command- these are usually two completely different domain!

You need to ask your IP-provider to create a rDNS entry!


Well, yeah,

ok - so it would really be the

but I don’t think so

as already said, it prompts host.myprovider.xy

So my new question would be: tell the domain/vserver hoster to register mail.mydomain.xy or
And the other questions remain somehow unanswered to in that context.

Thank you, regards,


I am currently confused.

Is there a rDNS entry? It says “IP is host.myprovider.xy”, right? Well, obviously this does not match your postfix hostname!
So your rDNS entry should match an official domain (not something like “int” or “local” or “internal”)- so I suggest to ask your provider to create an entry pointing to mail.mydimain.xy. And then configure your postfix accordingly.


Sorry for confusing :roll_eyes:

I will try to explain the DNS setting perhaps with the commands:

root@myhost:~# dig -x my.public.ip.adr

; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> -x my.public.ip.adr
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56832
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 0


;; ANSWER SECTION: 37246 IN	PTR	xyserver.domainhoster.country_xy.

;; AUTHORITY SECTION: 123648	IN	NS	nameserver2.domainhoster.country_xy. 123648	IN	NS	nameserver1.domainhoster.country_xy.


root@host:~# dig mydomain.country_xy mx

; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> mydomain.country_xy mx
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 9719
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 3

;mydomain.country_xy.			IN	MX

mydomain.country_xy.		86400	IN	MX	10 mail.mydomain.country_xy.

mydomain.country_xy.		3691	IN	NS	nameserver1.domainhoster.country_xy.
mydomain.country_xy.		3691	IN	NS	nameserver2.domainhoster.country_xy.

mail.mydomain.country_xy.	16584	IN	A	my.public.ip.adr
nameserver1.domainhoster.country_xy.		1744	IN	A	some1.public.ip.adr
nameserver2.domainhoster.country_xy.		1744	IN	A	some2.public.ip.adr


root@host:~# dig @some1.public.ip.adr

; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> @some1.public.ip.adr
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1447
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;	IN	A

;; ANSWER SECTION: 86400 IN	A	my.public.ip.adr

Is it possible to have multiple IN PTR records? Not recommended though
Ah I almost forgot:

root@host:/# postconf myhostname 
myhostname =


root@host:/# postconf smtp_helo_name
smtp_helo_name = mail.mydomain.country_xy 

I was trying followed the best practice setup for UCS domain-setup I guess (Welcher Domänenname?)


Well, this staes everything. The reverse entry points to xyserver.domainhoster… while the MX entry points to
Again, let your provider change the rDNS entry and you will be fine.

I am unsure about the myhostnamee and smtp_helo_name, but you should be fine with these settings.
Just make sure you will never ever use int.mydomain.xy outside of your network!
I prefer to use internally the same domain name as officially…


thank you knebb! I found the relevant FAQ from my domainhoster too. It is now possible to change the PTR record. So I will do that.

But before that, I need to be clear on what fdqn I will tell the domainhoster. (Is it even relevant as long as it reflects mydomain.country_xy for my IP4 address?)

There is still the topic of the mismatch between the postconf myhostname in UCS and the actual MX record. Also, letting myhostname unchanged with another MX record/smtp_helo_name exposes anyway? At least if I look into email headers. So what is the point here?
So I either leave everywhere or change it to mail.mydomain.country_xy (same IP of course) or …?


Edit: I have posed the question again here (Postfix myhostname 4.2) as the GMX problem and solution is solved here - thanks to @knebb.


what a receiving mail server does is the following steps:

  1. When an SMTP connection from, let’s say, is accepted, the PTR record for is looked up. Let’s say it resolves to
  2. Next the receiving SMTP server resolves that host name it just got back in step one, meaning it’ll query for an A record for It’ll receive one or more IPv4 addresses for it.
  3. Now it verifies that at least one of the IPv4 addresses returned in step 2 is the one it accepted the connection from.

There’s often a bit more to it[1], but that’s basically it. Meaning the host name used isn’t all that important; what’s important is that this round-trip look-up works.

Note that MX records do not play into this! MX records are used for sending mail to a specific domain, not for verifying that a certain mail server may send mail from that domain. That’s what the SPF (Sender Permitted From) framework is used for.

[1] Some more checks a receiving mail server does:

  1. Verification that the host name returned in step 1 doesn’t look like host names typically assigned to dynamic IPv4 addresses
  2. That the host name the sending mail server sens in its HELO or EHLO header actually exists and is resolvable (that’s what your Postfix book is talking about when mentioning Postfix’s myhostname variable)

Kind regards,

1 Like