Wednesday, 16 July 2014

How to set up Postfix to use /etc/hosts first and then DNS server for lookups

What:

Linux server with Postfix mail transfer agent (MTA)

Problem:

We need Postfix to use /etc/hosts file first when performing a DNS lookups.

Solution:

Edit /etc/postfix/main.cf and use following configuration for lookups:
lmtp_host_lookup = native
smtp_host_lookup=native
#disable_dns_lookups = yes
ignore_mx_lookup_error = yes
Reload postfix and test.

No comments:

Post a Comment