Symptoms
Email sent to a domain that uses external mail and has the local mail service disabled is bounced with the following error in
/var/log/maillogpostfix/smtp[19079]: 408755E04C2: [email protected], relay=none, delay=0.14, delays=0.14/0/0/0, dsn=5.4.6, status=bounced (mail for example.com loops back to myself)
This domain's MX record won't resolve, and its A record points to Plesk
# host -t MX example.com
example.com has no MX record
# host example.com
example.com has address 192.0.2.2
# hostname -I
192.0.2.2The right MX record is returned when using a different DNS server
# host -t MX example.com 1.1.1.1
Using domain server:
Name: 1.1.1.1
Address: 1.1.1.1#53
Aliases:example.com mail is handled by 10 externalmail.example.com.
Cause
Postfix (the mail delivery service) tries to connect to itself because the DNS server returns the wrong IP address when the affected domain is queried.
Resolution
Connect to the server over SSH
Open
/etc/resolv.conffor editingChange the
nameserverin/etc/resolv.confto a valid DNS server, such as 1.1.1.1Note: If an external program manages this file, such as
NetworkManagerorresolvconf, configure it following its documentation to prevent changes to it.# cat /etc/resolv.conf
nameserver 1.1.1.1Remove
localhostand/or127.0.0.1if either is configured as a nameserver in/etc/resolv.conf