What the message looks like
postfix/smtp[2314]: 4F1A2B3C4D: to=<kunde@example.net>, relay=none, delay=0.5, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=example.net type=MX: Host not found, try again)Common causes
- The DNS resolver is unreachable or misconfigured:
/etc/resolv.conf, systemd-resolved or a blocked port 53. - Postfix runs in a chroot and does not find a copy of
resolv.confthere. - The recipient domain has a typo, no MX or A record, or its name servers fail.
- A local firewall blocks outgoing DNS queries.
- A short-term DNS outage: “try again” means the error is temporary.
Check
- Does the lookup work from the shell?
- Which resolver is configured?
cat /etc/resolv.conf - Does the Postfix chroot have its own copy?
ls -l /var/spool/postfix/etc/resolv.conf - Related Postfix settings
postconf -n | grep -E 'disable_dns_lookups|smtp_host_lookup|myhostname'
Fix
- Fix the resolver, or install a local caching one such as unbound, so DNS no longer fails.
- Refresh the chroot copy and restart:
cp /etc/resolv.conf /var/spool/postfix/etc/resolv.conf && systemctl restart postfix. - Check the recipient address for typos and the domain with
dig MX. - Allow outgoing UDP and TCP port 53 in the firewall.
- After the fix, retry the queue:
postqueue -f.
Typical scenario
On one server you switched the DNS resolver from the provider's address to a local cache. Web applications resolve names fine, but Postfix delivers nothing any more: status=deferred (Host or domain name not found. Name service error for name=example.net type=MX: Host not found, try again). Postfix partly runs in a chroot and reads its own copy of resolv.conf there. Compare /etc/resolv.conf with /var/spool/postfix/etc/resolv.conf.
FAQ
Is “try again” a permanent error?
No. It is a temporary failure (4.x.x). Postfix keeps the message and tries again for several days.
How do I check my own domain's mail DNS?
Use the free mail DNS checker for MX, SPF, DKIM, DMARC and PTR.
What do type=MX and type=A in the message tell me?
They show which DNS query failed. Postfix first asks for the domain's MX records and then for the A or AAAA records of the hosts. If the MX query already fails, the fault is in the resolver or the domain, not in a single mail server.
Why does it happen for one domain only, not others?
Then it usually lies with that domain: its name servers do not answer, or the zone has a DNSSEC problem that a validating resolver rejects with SERVFAIL. Check with dig MX domain, and if needed against another resolver, whether the query goes through there.
How do I avoid the chroot problem permanently?
Either you refresh the chroot copy after every resolver change, or you switch off the chroot for the smtp service in master.cf by setting n in the chroot column. After that the service reads the real /etc/resolv.conf.