LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-15-2009, 08:42 AM   #1
targettl
Member
 
Registered: Sep 2009
Location: Launceston
Distribution: Kubuntu
Posts: 84

Rep: Reputation: 16
Postfix with smtp not working "Host or domain name not found."


I am trying to send mail to other machines without using some else's smtp server. In the end I want to send server logs to an account on a seperate but local mail server.

Kubuntu Jaunty
apt-get postfix
dpkg-reconfigure postfix
apt-get mailutils
mail user@host.domain
mailq or more /var/log/mail.log
I either get Connection timed out or No route to host
or Host not found, try again

Some errors are from trying to email external servers which might be prevented because ISP's block it I think. telnet ip port 25 doesn't work
But telnet works for the local ones

I can browse the web so dns should be okay.
Does postfix read the hosts table first?
I can ping the host I put in hosts table
But postfix says Host not found
 
Old 09-16-2009, 10:01 AM   #2
bhaslinux
Member
 
Registered: Oct 2003
Location: UnitedKingdom
Distribution: Debian Bullseye
Posts: 357

Rep: Reputation: 49
Your query is not clear

If you are creating an MTA to send mails to outside world
There are a few things to keep in mind
1. If you send the mail as-if appearing from your system, most of the SMTP mail servers will reject your mail
as the mail server from which mail is originating must
a) have a static ip address
b) must be reverse-resolveable by name.
However, you can ask your service provider to give you an smtp server to which you can do a smart-host transfer

If you are trying to send mails locally, internally to systems:
Just by adding the host name in the hosts file and sending mail abc@host.dom will not work.
The mx record for the domain/host must be resolve'able.
You might want to take a look at the SMTP RFC to understand more and also read-up on DNS MX records.
 
Old 09-16-2009, 03:40 PM   #3
DrLove73
Senior Member
 
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,118
Blog Entries: 1

Rep: Reputation: 129Reputation: 129
Best way to test if networking is correcty set on your mail server is to do following:

In terminal type like this:
Quote:
dig gmail.com MX
to see if your system is corectly resolving domain names (corectly set up DNS servers) you should get something like this:
Quote:
; <<>> DiG 9.3.4-P1 <<>> gmail.com MX
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24561
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 13, ADDITIONAL: 7

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

;; ANSWER SECTION:
gmail.com. 2265 IN MX 5 gmail-smtp-in.l.google.com.
gmail.com. 2265 IN MX 10 alt1.gmail-smtp-in.l.google.com.
gmail.com. 2265 IN MX 20 alt2.gmail-smtp-in.l.google.com.
gmail.com. 2265 IN MX 30 alt3.gmail-smtp-in.l.google.com.
gmail.com. 2265 IN MX 40 alt4.gmail-smtp-in.l.google.com.

;; AUTHORITY SECTION:
com. 77508 IN NS H.GTLD-SERVERS.NET.
com. 77508 IN NS I.GTLD-SERVERS.NET.
com. 77508 IN NS J.GTLD-SERVERS.NET.
com. 77508 IN NS K.GTLD-SERVERS.NET.
com. 77508 IN NS L.GTLD-SERVERS.NET.
com. 77508 IN NS M.GTLD-SERVERS.NET.
com. 77508 IN NS A.GTLD-SERVERS.NET.
com. 77508 IN NS B.GTLD-SERVERS.NET.
com. 77508 IN NS C.GTLD-SERVERS.NET.
com. 77508 IN NS D.GTLD-SERVERS.NET.
com. 77508 IN NS E.GTLD-SERVERS.NET.
com. 77508 IN NS F.GTLD-SERVERS.NET.
com. 77508 IN NS G.GTLD-SERVERS.NET.

;; ADDITIONAL SECTION:
A.GTLD-SERVERS.NET. 72491 IN A 192.5.6.30
A.GTLD-SERVERS.NET. 72491 IN AAAA 2001:503:a83e::2:30
B.GTLD-SERVERS.NET. 72491 IN A 192.33.14.30
B.GTLD-SERVERS.NET. 72491 IN AAAA 2001:503:231d::2:30
C.GTLD-SERVERS.NET. 72491 IN A 192.26.92.30
D.GTLD-SERVERS.NET. 72491 IN A 192.31.80.30
E.GTLD-SERVERS.NET. 72491 IN A 192.12.94.30

;; Query time: 105 msec
;; SERVER: x.x.219.89#53(x.x.219.89)
;; WHEN: Wed Sep 16 21:26:38 2009
;; MSG SIZE rcvd: 510
Take notice on the
Quote:
;; ANSWER SECTION:
we got 5 mail servers for "gmail.com" domain. next try to get ip for one of them:
Quote:
dig gmail-smtp-in.l.google.com
. Part of the response is:
Quote:
;; ANSWER SECTION:
gmail-smtp-in.l.google.com. 82 IN A 74.125.79.27
This means that you can resolve other mail servers from your server, and that you should follow steps bhaslinux wrote.

I as ISP, I block ANY connection originating from my network that has destination post 25 with IP other then my mail server's. This is to prevent SPAM-ing and blacklisting my IP with other mail servers arround the world. Also, I have active "reverse-resolveable by name" protection bhaslinux mentioned, so any connection from IP that has no reversed DNS record is blocked, like this:
Quote:
Sep 16 21:33:03 sagittarius postfix/smtpd[1994]: connect from unknown[201.221.147.75]
Sep 16 21:33:04 sagittarius postfix/smtpd[1994]: NOQUEUE: reject: RCPT from unknown[201.221.147.75]: 504 5.5.2 <RKLOUMBVHL>: Helo command rejected: need fully-qualified hostname; from=<mitigateb8@rotted.com> to=<igor@xxxxx.net> proto=ESMTP helo=<RKLOUMBVHL>
Sep 16 21:33:04 sagittarius postfix/smtpd[1994]: lost connection after DATA from unknown[201.221.147.75]
Sep 16 21:33:04 sagittarius postfix/smtpd[1994]: disconnect from unknown[201.221.147.75]
or that is already reported by someone as SPAM-er:
Quote:
Sep 16 21:33:06 sagittarius postfix/smtpd[1987]: NOQUEUE: reject: RCPT from unknown[200.135.234.78]: 554 5.7.1 Service unavailable; Client host [200.135.234.78] blocked using zen.spamhaus.org; http://www.spamhaus.org/query/bl?ip=200.135.234.78; from=<igor@xxxxx.net> to=<igor@xxxxx.net> proto=ESMTP helo=<[200.135.234.78]>
Sep 16 21:33:07 sagittarius postfix/smtpd[1987]: disconnect from unknown[200.135.234.78]
 
  


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 returns "Relay Access Denied (smtp code 554)" bornfree Linux - Server 3 09-30-2008 12:01 PM
Why am I getting "type=MX: Host not found" errors in my postfix queue? skooby.doo Linux - Networking 2 04-26-2007 02:40 PM
How do I configure Postfix to save my outgoing SMTP mail in my IMAP "Sent Items"? wired Linux - Newbie 1 02-01-2006 01:12 AM
Couldn't display "SMB:///" , No host "(Null)" could been Found?????? munkey Linux - Newbie 3 05-03-2004 05:30 PM
Couldn't display "SMB:///" , No host "(Null)" could been Found?????? help munkey Fedora 6 04-30-2004 07:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07: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