postfix can't find DNS server after upgrade to ubuntu 17.04
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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
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.
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...
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
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.
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
Last edited by bathory; 05-26-2017 at 02:27 AM.
Reason: typo
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?
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
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)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.