LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 09-29-2008, 06:40 PM   #1
kayasaman
Member
 
Registered: Sep 2008
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443

Rep: Reputation: 32
Postfix not sending mail - Host MX records not found?


Hi,

I think it was last week where billymayday and Mr C. helped me out with my DNS server issues and it has been performing brilliantly since then.

On my, what I call domain server (web and mail), however postfix doesnt seem to be able to send any outbound mail at all.

The exact error I'm getting is:

Code:
Sep 30 02:22:42 OptiplexGX270T postfix/smtp[27048]: 3B6CE5AC19: to=<kayasaman@server.optiplex-networks.com>, relay=none, delay=10, delays=0.07/0.01/10/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=server.optiplex-networks.com type=MX: Host not found, try again)
In resolv.conf it is set to use master DNS server from my main server (all fine!) and both dig and nslookup work ok.

I can't understand this unless I need some extra config in the DNS that I don't know about?

I also would like to know if my MX records for local machines are correct in my zone file:

Code:
optiplex-networks.com.    IN      MX      10      mail.optiplex-networks.com.
mail.optiplex-networks.com.              IN      A       192.168.1.50
optiplex-networks.com.   IN      TXT     "v=spf1 ip4:192.168.1.50 a mx ~all"
mail                    IN      TXT     "v=spf1 a -all"
mail.server.optiplex-networks.com.      IN      A       192.168.1.41
@                       IN      MX      10      server.optiplex-networks.com.
So once we have postfix sending again maybe someone can help me with this aswell since Mr C.'s documentation claims to put:

Code:
@      IN         MX        10       domain.com.
while all other places on the net including Cisco documentation for router DNS config with MX records say to put:

Code:
mail.domain.com.       IN        MX       10      domain.com
I am really confused with the conflicting syntax.

Anyway one step at a time Postfix first>

if anyone knows why this is happening I would be really greatful to work on a fix!

Thanks.
 
Old 09-29-2008, 07:01 PM   #2
racracracrac
Member
 
Registered: Sep 2008
Posts: 44

Rep: Reputation: 15
Your problem isn't postfix, its DNS. One of the problems new people to *nix find is that there are more than one way to do anything.

If you run the following command on your server for your domain (server.optiplex-networks.com.) and for linuxquestions.org, you will see the difference. Specifically under the ANSWER section.

dig mx linuxquestions.org.
dig mx server.optiplex-networks.com.

In my dns cfg, I use the following:

domain.com. IN MX 10 mail
mail.domain.com. IN A 123.123.123.123

Last edited by reddazz; 10-14-2008 at 05:59 PM. Reason: Removed spammed links
 
Old 09-29-2008, 07:20 PM   #3
kayasaman
Member
 
Registered: Sep 2008
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443

Original Poster
Rep: Reputation: 32
Ok but however bare in mind that I only want this domain server.optiplex-networks.com to be mailed by inside computers only which means that I need to tap into my local DNS relay and correct the syntax I'm guessing.

If you did a dig on my domain name you will be reffered to the DNS servers of the place I got the domain from since my DNS server isn't authoritve outside of my local subnet.

If you do an nslookup you will see that the NS names an IP addresses are not ns1.optiplex-networks.com and 81.178..... my WAN IP instead they will be ns1.domains.com or something like that.

So I will try your syntax!

Look up of dig:

Code:
; <<>> DiG 9.3.4-P1.1 <<>> mx server.optiplex-networks.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36935
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;server.optiplex-networks.com.  IN      MX

;; AUTHORITY SECTION:
optiplex-networks.com.  604800  IN      SOA     ns1.optiplex-networks.com. mail.optiplex-networks.com. 2008093005 7200 120 2419200 604800

;; Query time: 54 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue Sep 30 03:13:55 2008
;; MSG SIZE  rcvd: 91
This was done for the local domain:

Code:
; <<>> DiG 9.3.4-P1.1 <<>> mx optiplex-networks.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 27702
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 1, ADDITIONAL: 3

;; QUESTION SECTION:
;optiplex-networks.com.         IN      MX

;; ANSWER SECTION:
optiplex-networks.com.  604800  IN      MX      10 mail.optiplex-networks.com.
optiplex-networks.com.  604800  IN      MX      10 server.optiplex-networks.com.
;; AUTHORITY SECTION:
optiplex-networks.com.  604800  IN      NS      ns1.optiplex-networks.com.

;; ADDITIONAL SECTION:
mail.optiplex-networks.com. 604800 IN   A       192.168.1.50
server.optiplex-networks.com. 604800 IN A       192.168.1.41
ns1.optiplex-networks.com. 604800 IN    A       192.168.1.51

;; Query time: 11 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue Sep 30 03:14:49 2008
;; MSG SIZE  rcvd: 149
hmm looks like somethings wrong??

As these two lines give the same domain name??

Code:
optiplex-networks.com.  604800  IN      MX      10 mail.optiplex-networks.com.
optiplex-networks.com.  604800  IN      MX      10 server.optiplex-networks.com.
Shouldn't one be server.optiplex-networks.com followed by mail.server.optiplex-networks.com?

Also since everything is 'in house' how do I then get my DNS server to lookup the MX records of other hosts on the internet?

Would I just tie my ISP's DNS servers into the zone file?
 
Old 09-29-2008, 07:34 PM   #4
kayasaman
Member
 
Registered: Sep 2008
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443

Original Poster
Rep: Reputation: 32
Ok this again doesn't make sense?

This is the zone file now:

Code:
optiplex-networks.com.       IN      NS      ns1.optiplex-networks.com.
optiplex-networks.com.    IN      MX      9      mail
optiplex-networks.com.    IN      A       192.168.1.50
gx110.optiplex-networks.com.    IN     A      192.168.1.51
ns1.optiplex-networks.com.      IN      A       192.168.1.51
www.optiplex-networks.com.      IN      A       192.168.1.50
mail.optiplex-networks.com.              IN      A       192.168.1.50
ftp.optiplex-networks.com.       IN      A       192.168.1.51
mail.gx110.optiplex-networks.com.       IN      A       192.168.1.51
ferrari3200.optiplex-networks.com.      IN      A       192.168.1.5
server.optiplex-networks.com.           IN      A       192.168.1.41
;optiplex-networks.com.   IN      TXT     "v=spf1 ip4:192.168.1.50 a mx ~all"
;mail                    IN      TXT     "v=spf1 a -all"
mail.server.optiplex-networks.com.      IN      A       192.168.1.41
server.optiplex-networks.com.           IN      MX      11      mail.server
gx110.optiplex-networks.com.            IN      MX      10      mail.gx110
So the IN TXT parts have been commented out! Wich since it uses the ~all and -all parts may have been overriding the system?

Anyway so here is the reply from: dig mx server.optiplex-networks.com

Code:
; <<>> DiG 9.3.4-P1.1 <<>> mx server.optiplex-networks.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59834
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2

;; QUESTION SECTION:
;server.optiplex-networks.com.  IN      MX

;; ANSWER SECTION:
server.optiplex-networks.com. 604800 IN MX      11 mail.server.optiplex-networks.com.

;; AUTHORITY SECTION:
optiplex-networks.com.  604800  IN      NS      ns1.optiplex-networks.com.

;; ADDITIONAL SECTION:
mail.server.optiplex-networks.com. 604800 IN A  192.168.1.41
ns1.optiplex-networks.com. 604800 IN    A       192.168.1.51

;; Query time: 1 msec
;; SERVER: 192.168.1.51#53(192.168.1.51)
;; WHEN: Tue Sep 30 03:31:32 2008
;; MSG SIZE  rcvd: 117
and here is postfix answer:

Code:
Sep 30 03:33:15 OptiplexGX270T postfix/smtp[7669]: 1E19C5AC1D: to=<kayasaman@server.optiplex-networks.com>, 
relay=none, delay=10, delays=0.08/0.01/10/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for 
name=server.optiplex-networks.com type=MX: Host not found, try again)
I don't get it!

This happened ever since I swapped using my router as DNS server to my main server.
 
Old 09-29-2008, 08:03 PM   #5
kayasaman
Member
 
Registered: Sep 2008
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443

Original Poster
Rep: Reputation: 32
Wow this is wierd I restarted Postfix from the init.d script and now it works??

OKKKKK......

But thank you racracracrac for the MX records!

However I do feel that it will go down again? As it seemed to behave like this last time aswell.
 
Old 09-30-2008, 01:15 AM   #6
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 59
Kayasaman,

I find it extremely difficult to follow your process, as there are just too many random changes without understanding or validation.

An MX record instructs mail server where to send mail for a domain.
You can ave a single MX for all of optiplex-networks.com pointing to your mail server.

In the first post, you mentioned:
Quote:
So once we have postfix sending again maybe someone can help me with this aswell since Mr C.'s documentation claims to put:
@ IN MX 10 domain.com.

while all other places on the net including Cisco documentation for router DNS config with MX records say to put:

Code:

mail.domain.com. IN MX 10 domain.com
I think you misunderstand @, which is BIND shorthand for the current ORIGIN. So @ must be taken in context to be meaningful.
The first MX RR above says that all mail for the domain in the current ORIGIN should be sent to the host [sic] domain.com.
Your second RR says all mail for the domain (host?) mail.domain.com should be sent to the [sic] host named domain.com. If @
is mail.domain.com, then the two RRs above are the same. If ORIGIN is something other than mail.domain.com, then the two RR's
above are different.

The BIND User Manual will be very informative: http://www.isc.org/sw/bind/arm95/Bv9ARM.pdf
 
Old 10-10-2008, 12:38 PM   #7
kayasaman
Member
 
Registered: Sep 2008
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443

Original Poster
Rep: Reputation: 32
Thanks again Mr C. sorry just caught your reply!
 
Old 01-20-2012, 11:37 AM   #8
b8rt
LQ Newbie
 
Registered: Dec 2006
Posts: 8

Rep: Reputation: 0
When postfix was failing to send mail for me with the error "Host or domain name not found.", I was missing the resolver configuration in postfix's chroot. To resolve (pun intended):

Code:
cp /etc/resolv.conf /var/spool/postfix/etc
/etc/init.d/postfix restart
-
bart
 
Old 01-20-2012, 11:47 AM   #9
kayasaman
Member
 
Registered: Sep 2008
Location: Under the bridge where proper engineers walkover
Distribution: Various Linux, Solaris, BSD, Cisco
Posts: 443

Original Poster
Rep: Reputation: 32
Quote:
I was missing the resolver configuration in postfix's chroot.
This is quite an old post, nice that you found

Yes indeed when running chroot environments, anything needed by the service within the chroot jail would need to be copied into the chroot path.

An example of running Bind9 (DNS service) in chroot environment would be say:

Code:
chroot jail root dir:/var/named

relative directories could be: $ROOT/etc, $ROOT/var $ROOT/lib
meaning that anything that should be in /etc for the service would now be within /var/named/etc/.... or for /var would be in /var/named/var/... relative to the systems main / dir of course.

One could even take this a step further into using the FreeBSD jail environments which give the added extra of devoting a NIC to the jail with it's own IP address and even kernel (Buildworld). Or of course you could just dump it into a Solaris Zone or Container. - that's beside the point though!

Anyway glad the post helped if it did


Regards
 
  


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
Postfix sending mail outside guy_ripper Linux - Server 1 05-17-2008 10:25 AM
sending mail using postfix fakie_flip Linux - Software 5 12-31-2007 05:01 AM
Postfix mail transfer agent not sending mail locally or to other servers sketelsen Linux - Software 3 02-09-2006 11:16 AM
Postfix+Courier-IMAP virtual user not found when sending mail hawkpaul Linux - Software 0 05-03-2004 11:02 AM
Sending mail via Postfix smtpd through remote host requiring authentication Saffsd Linux - Networking 0 01-26-2004 05:05 AM


All times are GMT -5. The time now is 11:28 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration