LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-23-2017, 09:21 AM   #1
adrianmariano
Member
 
Registered: Dec 2004
Distribution: Ubuntu Yakkety
Posts: 188

Rep: Reputation: 15
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?
 
Old 05-24-2017, 10:10 PM   #2
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.5
Posts: 2,001

Rep: Reputation: 626Reputation: 626Reputation: 626Reputation: 626Reputation: 626Reputation: 626
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.
 
Old 05-24-2017, 10:27 PM   #3
adrianmariano
Member
 
Registered: Dec 2004
Distribution: Ubuntu Yakkety
Posts: 188

Original Poster
Rep: Reputation: 15
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.
 
Old 05-25-2017, 03:13 AM   #4
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.5
Posts: 2,001

Rep: Reputation: 626Reputation: 626Reputation: 626Reputation: 626Reputation: 626Reputation: 626
Quote:
Originally Posted by adrianmariano View Post
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...
 
Old 05-25-2017, 03:59 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,294

Rep: Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698
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
 
Old 05-25-2017, 10:21 AM   #6
adrianmariano
Member
 
Registered: Dec 2004
Distribution: Ubuntu Yakkety
Posts: 188

Original Poster
Rep: Reputation: 15
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.
 
Old 05-26-2017, 03:00 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,294

Rep: Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698
Quote:
Originally Posted by adrianmariano View Post
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 03:27 AM. Reason: typo
 
Old 05-26-2017, 07:00 AM   #8
adrianmariano
Member
 
Registered: Dec 2004
Distribution: Ubuntu Yakkety
Posts: 188

Original Poster
Rep: Reputation: 15
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?
 
Old 05-26-2017, 07:42 AM   #9
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,638

Rep: Reputation: 434Reputation: 434Reputation: 434Reputation: 434Reputation: 434
Quote:
Originally Posted by adrianmariano View Post
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
 
Old 05-26-2017, 08:59 AM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,294

Rep: Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698
Quote:
Originally Posted by adrianmariano View Post
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)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help to configure internal Postfix server without DNS. manoj_b Linux - Newbie 3 07-15-2009 02:44 AM
LXer: Find out DNS Server Version With DNS Server Fingerprinting Tool LXer Syndicated Linux News 0 12-21-2007 06:30 PM
LXer: Find out DNS Server Version With DNS Server Fingeprinting Tool LXer Syndicated Linux News 0 12-21-2007 05:50 PM
Postfix without DNS Server for Small LAN LinuxGeek Linux - Networking 5 12-19-2006 09:00 AM
Mail Server Reverse DNS and Postfix streamalot Linux - General 1 10-15-2003 02:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration