Is there a solution to force postfix to check the MX of a domain name ?

Dear All,

Operating system CentOS Linux 7.2.1511
Webmin version 1.791

Let’s say my server’s hostname is I also run various web based software packages, which send out e-mail to customers. This works great. The problem is that my server also sends out e-mail to

The problem is that the e-mail is not hosted on this server, it’s actually hosted on a 3rd party e-mail server, so I am not getting these e-mails. Is there a way of forcing Postfix to use the MX records for, even if this is the local name of the server? The server will not be receiving ANY e-mail, just send out.

I made given below changes

  1. in /etc/postfix/
    mydestination = $myhostname
    transport_maps = hash:/etc/postfix/transport

  2. nano /etc/postfix/transport

  3. postmap /etc/postfix/transport
    postfix reload

But, postfix still tries to deliver the mail locally and returns an error saying “Recipient address rejected: User unknown in virtual alias table”
Bind DNS server is running in the server. But none of the domains hosted in the server use the local nameservers and all of them use external nameservers.

I want a solution to force postfix to check the MX of all the domains (EXTERNALLY, and NOT based on the mx entries in my local Bind DNS Server ) hosted in my server and do the delivery of mails based on the mx records.
If mx record of domain1 is local, let it deliver locally, if the mx record of domain2 is external mail server, let it deliver externally (even if domain2 is hosted locally)

Please help in getting this resolved.

Thanks and Regards


Hmm, is it an option to change your server’s hostname to an FQDN such as

Then, email for can be hosted externally, and Postfix will only try to deliver email locally.


Hello Eric,
The server’s FQDN has already already been set to:
But still postfix tries to deliver mails locally not only to but for all the domains hosted in the vps.
Please help how to get rid of this postfix behaviour and force postfix do a mx lookup externally for all the domains.
(BTW, if this can’t be achieved with postfix, can i uninstall postfix and install Qmail? )
Thanks and Regards

Dear All,
Can i have help on this please?
Thanks and Regards


It shouldn’t be a problem to achieve what you’re after, though it sounds like something is “gumming up the works” at the moment, I’m just not sure what quite yet.

Do you by chance have a Virtual Server with the same name as your hostname? That is, is “” also setup as a Virtual Server? If so, are you by chance able to delete that, and see if that resolves your issue?

Note that the other thing is that if email is being hosted externally, not locally – you’d want to ensure that the Mail for Domain feature is disabled for the domains in question. Having Mail for Domain enabled will also cause Postfix to ignore the DNS settings and always deliver locally.

I would also recommend disabling BIND DNS Domain for any domain that has DNS hosted elsewhere, as that can cause some unusual issues.