Solved remote delivery deferred: DNS lookup failure: host not found

I upgraded to 13.0-RELEASE and then downgraded to 12.2-RELEASE. But, after this, I have noticed if I send mail through my webmail (SOGo Groupware) or K-9 android app it works. Unfortunately, sending mail through the terminal won't work:

Code:
$ echo 'ALERT - User Shell Access on:' `date` `who` | mail -s "Alert: User Access from `whoami`" someinbox@gmail.com

$ tail -f /var/log/maillog
.
.
.
Apr 19 03:38:46 core dma[187a8.800a760a0][63394]: remote delivery deferred: DNS lookup failure: host gmail.com not found
.
.
.

$ drill gmail.com
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 13600
;; flags: qr rd ra ; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 
;; QUESTION SECTION:
;; gmail.com.	IN	A

;; ANSWER SECTION:
gmail.com.	202	IN	A	142.250.185.101

;; AUTHORITY SECTION:

;; ADDITIONAL SECTION:

;; Query time: 16 msec
;; SERVER: 127.0.0.1
;; WHEN: Mon Apr 19 03:39:51 2021
;; MSG SIZE  rcvd: 43

$ host gmail.com
gmail.com has address 142.250.185.101
gmail.com has IPv6 address 2a00:1450:4001:80f::2005
gmail.com mail is handled by 10 alt1.gmail-smtp-in.l.google.com.
gmail.com mail is handled by 20 alt2.gmail-smtp-in.l.google.com.
gmail.com mail is handled by 30 alt3.gmail-smtp-in.l.google.com.
gmail.com mail is handled by 5 gmail-smtp-in.l.google.com.
gmail.com mail is handled by 40 alt4.gmail-smtp-in.l.google.com.

$ ping gmail.com
PING gmail.com (142.250.185.101): 56 data bytes
64 bytes from 142.250.185.101: icmp_seq=0 ttl=116 time=7.372 ms
64 bytes from 142.250.185.101: icmp_seq=1 ttl=116 time=7.107 ms
64 bytes from 142.250.185.101: icmp_seq=2 ttl=116 time=7.416 ms
^C
--- gmail.com ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 7.107/7.298/7.416/0.137 ms

$ cat /etc/resolv.conf
nameserver 127.0.0.1
options edns0

$ cat /etc/unbound/forward.conf
# This file was generated by local-unbound-setup.
# Modifications will be overwritten.
forward-zone:
	name: .
	forward-addr: 1.1.1.1
	forward-addr: 1.0.0.1
	forward-addr: 2606:4700:4700::1111
	forward-addr: 2606:4700:4700::1001

$ service local_unbound status
local_unbound is running as pid 36701.

It seems the DNS stuff is working. Any ideas what's wrong?
 
And here is the nslookup results:

Code:
$ nslookup gmail.com
Server:		127.0.0.1
Address:	127.0.0.1#53

Non-authoritative answer:
Name:	gmail.com
Address: 172.217.16.133
Name:	gmail.com
Address: 2a00:1450:4001:808::2005

$ nslookup 172.217.16.133
133.16.217.172.in-addr.arpa	name = fra15s46-in-f5.1e100.net.
133.16.217.172.in-addr.arpa	name = zrh04s06-in-f133.1e100.net.

Authoritative answers can be found from:
 
OK, I figured out what was wrong. It probably happened during the mergemaster phase.

Code:
$ cat /etc/mail/mailer.conf
# $FreeBSD$

sendmail  /usr/libexec/dma
mailq     /usr/libexec/dma
sendmail    /usr/local/sbin/sendmail
send-mail    /usr/local/sbin/sendmail
mailq        /usr/local/sbin/sendmail
newaliases    /usr/local/sbin/sendmail
hoststat    /usr/local/sbin/sendmail
purgestat    /usr/local/sbin/sendmail

I removed those dma lines and it's working again now:

Code:
$ cat /etc/mail/mailer.conf
# $FreeBSD$

sendmail    /usr/local/sbin/sendmail
send-mail    /usr/local/sbin/sendmail
mailq        /usr/local/sbin/sendmail
newaliases    /usr/local/sbin/sendmail
hoststat    /usr/local/sbin/sendmail
purgestat    /usr/local/sbin/sendmail
 
Back
Top