0

I've got the postfix configured to relay all emails to a mail server:

$ cat /etc/postfix/main.cf| grep relayhost | grep -v '#'

relayhost = smtp.local.lan

The problem is that postfix is not able to reach the mail server:

Aug 22 10:34:28 hcvsload postfix/smtp[32218]: 44FB840C4505: to=<daniel.ric@gmail.com>, relay=none, delay=0.13, delays=0.01/0.01/0.11/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=smtp.local.lan type=MX: Host not found, try again)

When i try to ping the mail server, it's working fine. But nslookup returns this:

$ nslookup smtp.local.lan
Server:         169.254.169.254
Address:        169.254.169.254#53

Non-authoritative answer:
smtp.local.lan   canonical name = smtp-app.local.lan.
Name:   smtp-app.local.lan.
Address: 10.1.2.140
** server can't find smtp-app.local.lan: NXDOMAIN

Any idea why nslookup returns NXDOMAIN even if it's able to resolve the name?

Krystian
  • 3
  • 3
  • `ping` and your check look for an `A` record, the error says `name=smtp.local.lan type=MX: Host not found` - in other words there is no `MX` record. Try `nslookup -type=mx smtp.local.lan` to check and create an MX record to resolve. – HBruijn Aug 22 '22 at 09:49
  • Thanks, that explained it. I've added `disable_dns_lookups=yes` to `/etc/postfix/main.cf` and now it's working as expexted – Krystian Aug 22 '22 at 12:49

0 Answers0