I'm testing two mail servers that live on two (virtual) machines with made up domain names for emails. When one of the servers needs to send an email to the other one, it seemingly performs a DNS lookup for the recipient domain's MX record, which doesn't point the sender server to the correct IP, no matter what IP/domain mapping I put in /etc/hosts
.
So should I install a DNS server and create a custom MX record for the recipient domain? How do I do this on Ubuntu or is there an easier way?
Assuming that present day Ubuntu servers typically use Postfix as the message transfer agent, it is possible to tell Postfix to disable DNS lookups for SMTP with disable_dns_lookups
configuration parameter. Add the following line
disable_dns_lookups = yes
to the Postfix's configuration file located at /etc/postfix/main.cf
. This will make Postfix look into /etc/hosts
when it tries to resolve the domain address of a mail recipient.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With