Proxmox Dynamic FQDN?


Active Member
Sep 18, 2019
Hi guys!
I'm setting up a PMG and the customer has multiple domains lets say, and and they want to send from all domains through the PMG. Before they were sending from their local Exchange server directly and now it should be done through the PMG :) The local domain is company.local.

When I'm sending test mails to I get the following error:
"We could not find a server (A-Record) for your hostname"

Which is correct, because there is no such A-Record. But for I can't set an A-Record because they don't own company.local.
My idea is, that the PMG uses as hostname, if someone sends from his mailbox and if there is another user let's say the PMG uses as his hostname in the Mail Header.

Am I having a error in my thoughts? Is this possible?

Or should I set the hostname to and then do PTR records for and

Here are the config files:


Code: localhost.localdomain localhost pmg

# The following lines are desirable for IPv6 capable hosts

::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

search company.local
Yea, I think they should hire someone who knows this stuff.

What exactly is your motivation in responding to a thread like mine with the intention of not helping but offending me for not knowing something?

I truly feel sorry for you spending time of your life with responding in forums for offending people.
  • Like
Reactions: Bob.Dig
to (semi) answer the original question, i don't think this is easily possible.

the only thing that comes to mind how it *could* work is to have multiple postfix instances, each responsible for a single
domain/hostname, but that would be a highly customized setup that won't be supported by us (if it's even possible to integrate properly)

but why is it so important what the hostname says ? shouldn't it just work to use either or ?
The PMG isn't directly on the internet, is it? It only runs as a smart host?

I would recommend using the PMG as an incoming and outgoing server, ideally it is also located on the Internet and can accept and process the e-mails directly itself. By using a transfer network, the IP can still be secured via a firewall. If he then gets an FQDN, you can also set the A-record correctly.

It does not matter whether the server is called or actually "" for the transmission of the e-mails. It is important that the configuration is state-of-the-art.
Thank you for your answer.
PMG ist incoming and outgoing server.

The company has two "departments" with two different domains to send and receive E-Mails from. Receiving from multiple domains is no problem, I set that up in the relay domains.

But when it comes to sending from or, the mail score from has -3 points because " We could not find a server (A-Record) for your hostname

That's obvious because there is no A-Record for That's the hostname of the PMG with the local domain FQDN.

So my question is: Can the FQDN of the PMG, which is sent in the mail headers be depended of the domain of the sender who sent the mail?

So when sends his mail, the PMG sends in the mail header "my hostname is" and when sends a mail, the PMG sends in the mail header "my hostname is"?

Then I could easily set the A-Records for both domains and have the perfect mail score :)
It doesn't seem like you've read or understood our answers. The solution would be to simply give the PMG an external IP with an A record. Whether the server name is in there or doesn't matter anymore. It would probably be enough if you have a WAN IP and would route the A record to it and just rename the PMG.

Or what prevents you from doing so?
The PMG is reachable on Port 25 through the internet under a static public IP.

Well I guess you're right. That should solve the problem. I'll try it and let you know. Thanks for clarifying :)


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!