[SOLVED] DNS domain in main.cf


New Member
Oct 27, 2019
I'm running 2 servers with Proxmox Mail Gateway in cluster mode :). One is the master, the other the slave.

I was debugging an issue with the smtpd_banner setting in /etc/postfix/main.cf and in the end I could solve it. I'd like to talk you through the process.

First I discovered the variable 'myhostname' was used on line 11, before it was declared on line 23. After I moved (in the template file) both mydomain and myhostname above line 11, the issue was fixed on the master.

I did the same for the slave. However, for some reason the mydomain and myhostname are not being filled in correctly:
mydomain = localdomain
myhostname = mailgw2.localdomain

The following settings are in place:
  • My /etc/hostname is containing the FQDN: mailgw2.mydomain.xx
  • /etc/hosts contains an entry with the hostname and FQDN: mailgw2.mydomain.xx mailgw2
  • /etc/mailname contains the FQDN: mailgw2.mydomain.xx
  • hostname -f returns the FQDN: mailgw2.mydomain.xx
After some time i found out that apparently I was missing the search mydomain.xx entry in /etc/resolv.conf.

I am not in control of the DHCP server and it is not providing the search domain option. If I add the search option manually and run pmgconfig sync the postfix configuration is working! Now to find the best way to make it persistent.

I hope I could save someone else the trouble.
Thanks for sharing your experience - this question does pop up every now and then - you probably already helped someone (or will do so in the future)!


The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!