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?