0

in my postfix logs I often see that postfix failed to send an email to root@levinus [my hostname] because theres no DNS record for levinus. But in my /etc/hosts is an entry for levinus (--> 127.0.0.1 AND my static IP). With ping I can reach levinus, then I ping myself. But why postfix doesnt accepts the /etc/hosts entrys?

Piece of the postfix log:

BC59A2FE000B: to=<root@levinus>, relay=none, delay=0.03,    
delays=0.01/0/0.02/0, dsn=5.4.4, status=bounced (Host or domain name not   
found. Name service error for name=levinus type=AAAA: Host not found)
Oct 11 14:47:29 levinus postfix/qmgr[29217]: BC59A2FE000B: removed

Part of /etc/hosts:

[STATIC IP] levinus
127.0.0.1 localhost.localdomain localhost levinus

System is Ubuntu 14.04 LTS.

//Edit With inet_protocols = ipv4 in main.cfg from postfix the same. Only the error message is another (type = A). When I add levinus to the IPv6 entry ::1 in /etc/hosts its the same (type = AAAA)

//Edit2 postfix logs even with the levinus hostname:

Oct 12 14:40:33 levinus postfix/smtpd[10103]: connect from levinus[127.0.0.1]
Oct 12 14:40:33 levinus postfix/smtpd[10103]: disconnect from levinus[127.0.0.1]

But all mails too root@levinus are still bounced.

Even when I edit the /etc/nsswitch.conf to hosts: files only postfix dont knew the own hostname. Before it was set to hosts: files dns.

levinus
  • 35
  • 7

1 Answers1

0

The problem is not with IPv4 address but IPv6 due to AAAA record is not exist.

This can be resolved by switching postfix to use only IPv4. sudo postconf -e 'inet_protocols = ipv4' then reload postfix.

Aizuddin Zali
  • 1,202
  • 1
  • 9
  • 17
  • Edited question, i isnt a solution :( – levinus Oct 11 '15 at 13:20
  • check in `/etc/nsswitch.conf` which option is the first one for `dns` line? – Aizuddin Zali Oct 11 '15 at 13:27
  • There wasnt a dns line, only the hosts line with the option dns: `hosts: files dns` – levinus Oct 11 '15 at 14:07
  • Have you any idea for a solution to this? – levinus Oct 13 '15 at 18:10
  • you need to disable IPv6 . Use this [guide](http://askubuntu.com/questions/440649/how-to-disable-ipv6-in-ubuntu-14-04). – Aizuddin Zali Oct 14 '15 at 04:00
  • Ipv6 is disabled, its the same problem, in the log is only shown type = A instead of type = AAAA. – levinus Oct 14 '15 at 05:07
  • you can ignore this because `levinus` does not have entry in DNS record, its working as design, trying to lookup on DNS and then no entry (this is when you see the information on log) then continue with `hosts`. `A` and `AAAA` record error is associated to DNS not `hosts` file. – Aizuddin Zali Oct 14 '15 at 05:14
  • But the log means that the mail is even bounced and it seems so: the mail is repeatet ~ 300 times per day. I dont know with program is sending the mail too. – levinus Oct 14 '15 at 05:24