LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 01-23-2012, 09:34 AM   #1
PimD1988
LQ Newbie
 
Registered: Jan 2012
Posts: 18

Rep: Reputation: Disabled
Unhappy Host unknown


Hello all,

To be honest I don't know if I'm in the correct section for this subject but I think this is most relevant.
My question is about mailing with sendmail which won't work. I have seen some other topics about this subject but because I'm pretty new to Linux so I thought of opening a new threat because I'm not getting any further with the other topics.

I have a server where I try to send mails from but that won't work.

As I don't know exactly where to look for I shall try to be as clear as possible

In my log file I have the following:

Quote:
Jan 23 13:33:39 aseg04 sendmail[6178]: q0NCXdit006178: from=root, size=77, class=0, nrcpts=1, msgid=<201201231233.q0NCXdit006178@localhost.localdomain>, relay=root@localhost
Jan 23 13:33:39 aseg04 sendmail[6179]: q0NCXdGH006179: from=<root@localhost.localdomain>, size=352, class=0, nrcpts=1, msgid=<201201231233.q0NCXdit006178@localhost.localdomain>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Jan 23 13:33:39 aseg04 sendmail[6178]: q0NCXdit006178: to=elvin@isioux.nl, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30077, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (q0NCXdGH006179 Message accepted for delivery)
Jan 23 13:33:39 aseg04 sendmail[6181]: q0NCXdGH006179: to=<elvin@isioux.nl>, ctladdr=<root@localhost.localdomain> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=120352, relay=172.30.2.13, dsn=5.1.2, stat=Host unknown (Name server: 172.30.2.13: host not found)
Jan 23 13:33:39 aseg04 sendmail[6181]: q0NCXdGH006179: q0NCXdGH006181: DSN: Host unknown (Name server: 172.30.2.13: host not found)
Jan 23 13:33:39 aseg04 sendmail[6181]: q0NCXdGH006181: to=<root@localhost.localdomain>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31586, dsn=2.0.0, stat=Sent
Which shows the email isn't sent.

Now the mail self:

Quote:
From MAILER-DAEMON@aseg04 Mon Jan 23 14:49:07 2012
Date: Mon, 23 Jan 2012 14:49:07 +0100
From: Mail Delivery Subsystem <MAILER-DAEMON@aseg04>
To: <root@localhost.localdomain>
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="q0NDn70f006835.1327326547/aseg04"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)

This is a MIME-encapsulated message

--q0NDn70f006835.1327326547/aseg04

The original message was received at Mon, 23 Jan 2012 14:49:07 +0100
from localhost.localdomain [127.0.0.1]

----- The following addresses had permanent fatal errors -----
<******@gmail.com>
(reason: 550 Host unknown)

----- Transcript of session follows -----
550 5.1.2 <******@gmail.com>... Host unknown (Name server: 172.30.2.13: host not found)

--q0NDn70f006835.1327326547/aseg04
Content-Type: message/delivery-status

Reporting-MTA: dns; aseg04
Received-From-MTA: DNS; localhost.localdomain
Arrival-Date: Mon, 23 Jan 2012 14:49:07 +0100

Final-Recipient: RFC822; ******@gmail.com
Action: failed
Status: 5.1.2
Remote-MTA: DNS; 172.30.2.13
Diagnostic-Code: SMTP; 550 Host unknown
Last-Attempt-Date: Mon, 23 Jan 2012 14:49:07 +0100

--q0NDn70f006835.1327326547/aseg04
Content-Type: message/rfc822

Return-Path: <root@localhost.localdomain>
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by aseg04 (8.13.8/8.13.8) with ESMTP id q0NDn70f006833
for <******@gmail.com>; Mon, 23 Jan 2012 14:49:07 +0100
Received: (from root@localhost)
by localhost.localdomain (8.13.8/8.13.8/Submit) id q0NDn1fh006832
for ******@gmail.com; Mon, 23 Jan 2012 14:49:01 +0100
Date: Mon, 23 Jan 2012 14:49:01 +0100
From: root <root@localhost.localdomain>
Message-Id: <201201231349.q0NDn1fh006832@localhost.localdomain>

test mail again
I am aware that these 2 are pieces of data are not the same. That is because I'm not able to find the mail on the server anymore because the mailbox of user root contains over 70000 mails But they cover the same issue.

But anyway I hope this gives enough information to help me solve the problem.

Is there please somebody who can help me with this?

Kind regards,

PimD1988
 
Old 01-23-2012, 09:53 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,474

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
You need to check and get your DNS working before you think about sorting out your mails.

Try the following
Code:
nslookup www.google.com
and you'll probably get an error message.

Check your /etc/resolv.conf and check that it's pointing to valid name servers.
Check your firewall to ensure that outbound DNS queries aren't getting blocked.

Then when you can do that try
Code:
dig mx google.com
and ensure you get something like the following back:
Code:
# dig mx google.com

; <<>> DiG 9.5.0b2 <<>> mx google.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 61978
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 4, ADDITIONAL: 9

;; QUESTION SECTION:
;google.com.                    IN      MX

;; ANSWER SECTION:
google.com.             600     IN      MX      30 alt2.aspmx.l.google.com.
google.com.             600     IN      MX      40 alt3.aspmx.l.google.com.
google.com.             600     IN      MX      50 alt4.aspmx.l.google.com.
google.com.             600     IN      MX      10 aspmx.l.google.com.
google.com.             600     IN      MX      20 alt1.aspmx.l.google.com.

;; AUTHORITY SECTION:
google.com.             11045   IN      NS      ns3.google.com.
google.com.             11045   IN      NS      ns4.google.com.
google.com.             11045   IN      NS      ns1.google.com.
google.com.             11045   IN      NS      ns2.google.com.

;; ADDITIONAL SECTION:
aspmx.l.google.com.     293     IN      A       209.85.229.27
alt1.aspmx.l.google.com. 293    IN      A       173.194.69.27
alt2.aspmx.l.google.com. 293    IN      A       209.85.137.27
alt3.aspmx.l.google.com. 293    IN      A       74.125.127.27
alt4.aspmx.l.google.com. 293    IN      A       74.125.81.27
ns1.google.com.         80317   IN      A       216.239.32.10
ns2.google.com.         80317   IN      A       216.239.34.10
ns3.google.com.         80317   IN      A       216.239.36.10
ns4.google.com.         80317   IN      A       216.239.38.10

;; Query time: 30 msec
;; SERVER: 172.29.143.19#53(172.29.143.19)
;; WHEN: Mon Jan 23 15:51:55 2012
;; MSG SIZE  rcvd: 352
Then see what happens when you send mail.
 
1 members found this post helpful.
Old 01-23-2012, 09:58 AM   #3
PimD1988
LQ Newbie
 
Registered: Jan 2012
Posts: 18

Original Poster
Rep: Reputation: Disabled
Hey TenTenths,

When I execute the first command (nslookup www.google.com) I get the following response:

Quote:
nslookup www.google.com
Server: 172.30.2.40
Address: 172.30.2.40#53

Non-authoritative answer:
www.google.com canonical name = www.l.google.com.
Name: www.l.google.com
Address: 209.85.147.147
Name: www.l.google.com
Address: 209.85.147.104
Name: www.l.google.com
Address: 209.85.147.103
Name: www.l.google.com
Address: 209.85.147.99
Name: www.l.google.com
Address: 209.85.147.106
Name: www.l.google.com
Address: 209.85.147.105
And when I exectute dig mx google.com I get this:

Quote:
dig mx google.com

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5_4.2 <<>> mx google.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55757
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 5

;; QUESTION SECTION:
;google.com. IN MX

;; ANSWER SECTION:
google.com. 350 IN MX 50 alt4.aspmx.l.google.com.
google.com. 350 IN MX 20 alt1.aspmx.l.google.com.
google.com. 350 IN MX 10 aspmx.l.google.com.
google.com. 350 IN MX 30 alt2.aspmx.l.google.com.
google.com. 350 IN MX 40 alt3.aspmx.l.google.com.

;; ADDITIONAL SECTION:
alt4.aspmx.l.google.com. 43 IN A 74.125.81.27
alt1.aspmx.l.google.com. 43 IN A 173.194.69.27
aspmx.l.google.com. 43 IN A 173.194.67.27
alt2.aspmx.l.google.com. 43 IN A 209.85.137.27
alt3.aspmx.l.google.com. 43 IN A 74.125.127.27

;; Query time: 95 msec
;; SERVER: 172.30.2.40#53(172.30.2.40)
;; WHEN: Mon Jan 23 16:48:09 2012
;; MSG SIZE rcvd: 216
So it all works fine from what I see except for finding the DSN host...
 
Old 01-23-2012, 10:15 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,474

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Hmm, strange, is it ALL e-mails that are problematic or only certain domains? Are you attempting direct e-mail delivery or through an intermediate smarthost?
 
Old 01-23-2012, 10:20 AM   #5
PimD1988
LQ Newbie
 
Registered: Jan 2012
Posts: 18

Original Poster
Rep: Reputation: Disabled
The mails are send through a webapplication written in PHP.
 
Old 01-23-2012, 10:25 AM   #6
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,474

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Ok, I meant are you trying to deliver them directly to the recipient's mail server or through a host.

In /etc/mail/sendmail.cf do you have an entry like:
Code:
# Smart host
DS
and if so, what is it.
 
Old 01-23-2012, 12:42 PM   #7
PimD1988
LQ Newbie
 
Registered: Jan 2012
Posts: 18

Original Poster
Rep: Reputation: Disabled
Oow no they are send straight to the recipient.
 
Old 01-24-2012, 02:26 AM   #8
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,474

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Hmm, only difference I can see is that your mailer looks like it's looking at 172.30.2.13 for DNS lookups and your other lookups were done at 172.30.2.40
 
Old 01-24-2012, 02:27 AM   #9
PimD1988
LQ Newbie
 
Registered: Jan 2012
Posts: 18

Original Poster
Rep: Reputation: Disabled
Ok, and how and where can I change that?
 
Old 01-24-2012, 02:38 AM   #10
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,474

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Check that /etc/nsswitch.conf has a line that begins hosts: and has dns on the line, also check /etc/resolv.conf to ensure that 172.30.2.40 is listed as a nameserver, alternatively post those files here.
 
Old 01-24-2012, 02:42 AM   #11
PimD1988
LQ Newbie
 
Registered: Jan 2012
Posts: 18

Original Poster
Rep: Reputation: Disabled
Ok done that,

/etc/nsswitch.conf returns:

Quote:
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
# nisplus or nis+ Use NIS+ (NIS version 3)
# nis or yp Use NIS (NIS version 2), also called YP
# dns Use DNS (Domain Name Service)
# files Use the local files
# db Use the local database (.db) files
# compat Use NIS on compat mode
# hesiod Use Hesiod for user lookups
# [NOTFOUND=return] Stop searching if not found so far
#

# To use db, put the "db" in front of "files" for entries you want to be
# looked up first in the databases
#
# Example:
#passwd: db files nisplus nis
#shadow: db files nisplus nis
#group: db files nisplus nis

passwd: files
shadow: files
group: files

#hosts: db files nisplus nis dns
hosts: files dns

# Example - obey only what nisplus tells us...
#services: nisplus [NOTFOUND=return] files
#networks: nisplus [NOTFOUND=return] files
#protocols: nisplus [NOTFOUND=return] files
#rpc: nisplus [NOTFOUND=return] files
#ethers: nisplus [NOTFOUND=return] files
#netmasks: nisplus [NOTFOUND=return] files

bootparams: nisplus [NOTFOUND=return] files

ethers: files
netmasks: files
networks: files
protocols: files
rpc: files
services: files

netgroup: nisplus

publickey: nisplus
and /etc/resolv.conf returns:

Quote:
nameserver 172.30.2.40
nameserver 172.30.2.41
nameserver 8.8.4.4
 
Old 01-24-2012, 02:45 AM   #12
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,474

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
That all looks right, so I'm at a loss as to why your sendmail was trying .13 for resolution.
 
Old 01-24-2012, 02:45 AM   #13
PimD1988
LQ Newbie
 
Registered: Jan 2012
Posts: 18

Original Poster
Rep: Reputation: Disabled
Haha yes so am I
 
Old 01-24-2012, 02:46 AM   #14
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Was that the original /etc/nsswitch.conf or did you change it? If you changed it, is the problem still happening?
 
Old 01-24-2012, 02:46 AM   #15
PimD1988
LQ Newbie
 
Registered: Jan 2012
Posts: 18

Original Poster
Rep: Reputation: Disabled
@catkin, I didn't change anything
 
  


Reply



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
Bind9 ,host does reslove a dns name but ping says unknown host Byenary Linux - Networking 10 01-12-2011 01:33 AM
Unknown Host BH_Exeter Linux - General 8 04-05-2006 01:44 PM
i m getting the error unknown host while im pinging with the host name gunjan thakkar Linux - General 2 12-14-2004 01:19 PM
unknown host hondaglx Linux - Networking 1 04-30-2004 11:02 PM
Unknown Host <Linuxmachinename> / Unable to ping by host name nishi_k_79 Linux - Networking 4 11-01-2003 01:24 PM

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

All times are GMT -5. The time now is 02:14 AM.

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
Open Source Consulting | Domain Registration