LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   postfix can't find DNS server after upgrade to ubuntu 17.04 (https://www.linuxquestions.org/questions/linux-server-73/postfix-cant-find-dns-server-after-upgrade-to-ubuntu-17-04-a-4175606508/)

adrianmariano 05-23-2017 08:21 AM

postfix can't find DNS server after upgrade to ubuntu 17.04
 
I upgraded to Ubuntu 17.04 and discovered that postfix is not able to find the DNS server and is unable to send mail as a result.

Code:

May 19 05:49:47 alpaca postfix/smtp[4151]: 5E923BC0C2D: to=<root@alpaca.cox.net>, orig_to=<root>, relay=none, delay=0.03, delays=0.03/0.01/0/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=smtp.east.cox.net type=MX: Host not found, try again)
Some investigation reveals that I can fix this problem temporarily by copying /etc/resolv.conf into the postfix tree, but it gets overwritten when the machine is rebooted, so this doesn't seem like it's the right answer.

What is the right answer?

scasey 05-24-2017 09:10 PM

I can't stand the silence... :)
I don't know squat about postfix, or ubuntu, for that matter. I don't know why an upgrade of your OS would break postfix.
I do know that "finding the DNS server" requires having nameserver entries in /etc/resolv.conf Please post
Code:

more /etc/resolv.conf
please.

adrianmariano 05-24-2017 09:27 PM

The contents of /etc/resolv.conf are

Code:

nameserver 68.100.16.25
nameserver 68.100.16.30
nameserver 68.105.28.12
search cox.net

Also the problem is temporarily fixed if I copy /etc/resolv.conf to /var/spool/postfix/etc/resolv.conf, which seems to be the file that postfix uses. But upon reboot, the postfix copy is reset to the empty file.

scasey 05-25-2017 02:13 AM

Quote:

Originally Posted by adrianmariano (Post 5714856)
The contents of /etc/resolv.conf are

Code:

nameserver 68.100.16.25
nameserver 68.100.16.30
nameserver 68.105.28.12
search cox.net

Also the problem is temporarily fixed if I copy /etc/resolv.conf to /var/spool/postfix/etc/resolv.conf, which seems to be the file that postfix uses. But upon reboot, the postfix copy is reset to the empty file.

So, where in postfix is the reference to that set? How to change that? I don't know...

bathory 05-25-2017 02:59 AM

Quote:

Also the problem is temporarily fixed if I copy /etc/resolv.conf to /var/spool/postfix/etc/resolv.conf, which seems to be the file that postfix uses. But upon reboot, the postfix copy is reset to the empty file.
It's a known problem when postfix is running chrooted.
Try the solutions proposed there and choose the one that fit your needs

Regards

adrianmariano 05-25-2017 09:21 AM

Hmmm. Based on that report, this problem has been around since 2015, and it's evidently still not fixed. I wonder why it only started for me upon my recent update. Note that my machine is a desktop, always wired, though I am using DHCP.

I'm left thinking that the real solution is to switch from postfix to some other MTA if they can't get postfix working reliably.

bathory 05-26-2017 02:00 AM

Quote:

Originally Posted by adrianmariano (Post 5715047)
Hmmm. Based on that report, this problem has been around since 2015, and it's evidently still not fixed. I wonder why it only started for me upon my recent update. Note that my machine is a desktop, always wired, though I am using DHCP.

I'm left thinking that the real solution is to switch from postfix to some other MTA if they can't get postfix working reliably.

You could change the staring order, so postfix starts after the network services.
Or you can run it not-chrooted, so it uses the main /etc/resolv.conf

adrianmariano 05-26-2017 06:00 AM

By "change the starting order" do you mean to follow the instructions in the linked bug report, where people talk about editing "/lib/systemd/system/postfix@.service" and adding an "After" line? It sounds like this mod might get clobbered every time postfix is updated, so it would be a bit of a maintenance nuisance. Is there some other mechanism that affects starting order?

descendant_command 05-26-2017 06:42 AM

Quote:

Originally Posted by adrianmariano (Post 5715411)
By "change the starting order" do you mean to follow the instructions in the linked bug report, where people talk about editing "/lib/systemd/system/postfix@.service" and adding an "After" line? It sounds like this mod might get clobbered every time postfix is updated, so it would be a bit of a maintenance nuisance. Is there some other mechanism that affects starting order?

Yes, you put it in /etc/systemd/system/postfix@.service

bathory 05-26-2017 07:59 AM

Quote:

Originally Posted by adrianmariano (Post 5715411)
By "change the starting order" do you mean to follow the instructions in the linked bug report, where people talk about editing "/lib/systemd/system/postfix@.service" and adding an "After" line? It sounds like this mod might get clobbered every time postfix is updated, so it would be a bit of a maintenance nuisance. Is there some other mechanism that affects starting order?

I'm not using ubuntu, so I have no systemd experience, but from what I guess you can try the solution at post #24 and create the file /etc/systemd/system/postfix@-.service.d/override.conf containing:
Code:

[Unit]
After=network-online.target

Or do what descendant_command posted above.

You can also try the solution at post #34 that apparently works (see post #35)


All times are GMT -5. The time now is 12:20 AM.