/etc/hosts contain folowing line:
127.0.0.1 localhost localhost.my.domain
but this file is not used:
# host localhost
Host not found.
#
Strange. Why this stuff don't work?
Main Topics
Browse All TopicsHello!
I am running Postfix 2.0.15 on FreeBSD 4.8.
After installation everything works fine, but then I added Kaspersky Antivirus content filter by modifying
main.cf:
content_filter = lmtp:localhost:10025
and master.cf:
localhost:10025 inet n n n - 10 spawn user=filter argv=/usr/local/share/AVP/
localhost:10026 inet n - n - 10 smtpd -o content_filter= -o myhostname="$hostname
after Postfix restart I got undeliverable mails with following record in my logfile:
Sep 19 20:28:53 ex postfix/lmtp[57579]: 968C93FB2: to=<user@myhost.net>, relay=none, delay=13, status=bounced (Name service error for name=localhost type=A: Host not found)
But command :
# ping localhost
PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.146 ms
shows, that localhost could be resolved.
kavkeeper on this localhost although runs fine:
# netstat -na | grep 100
tcp4 0 0 127.0.0.1.10026 *.* LISTEN
tcp4 0 0 127.0.0.1.10025 *.* LISTEN
So where is the problem? What localhost can't be found?
Any suggestions?
Thnx in advance,
Uldis
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Your problem is that the DNS server your postfix system is using isn't defining the localhost data. Such a fault would be a configuration error on the part of the DNS administrator.
It isn't obvious from the question as to where this nameserver is. If it is a local DNS server you need to correct the configuration or if it is that at your provider's you should complain to them.
Wow, just what exactly are you smoking? The DNS Server SHOULD NOT be handing out localhost! This is not your problem.
Postfix is a complex enough animal without throwing in misinformation!
Keep searching, this guy doesn't know what he's talking about!
I'm no expert in Postfix, but I know TCP/IP very well. If your system needs to do DNS lookups for localhost you have far bigger problems.
I would look into the "-o content_filter=" part. Since you don't provide any parameters to it, I'm guessing it doesn't know what to do with itself. You may have just not included it, but look for the closing " on the second line:
-o myhostname="$hostname
Good luck. I'm just learning Postfix, having been a long-time Sendmail fan, so I'm not claiming to know much. But I'm impressed with it... sorta.. :)
The DNS server isn't required to have or to hand out localhost definitions. However, since the localhost or loopback address is almost always 127.0.0.1 all references to DNS configuration suggest that you do provide that zone's data. The only way that there'd be problems with the DNS server providing localhost data would be if someone specifically configured a system to use something other than 127.0.0.1 as the loopback IP. Since that definition is universally accepted as being the loopback IP it is likely that many other applications would need adjustment to run on a system not using 127.0.0.1 as the loopback IP.
While this is true, it has absolutely no pertinence to the question at hand. "won't hurt" and "is the problem" are worlds apart.
Postfix doesn't use DNS to look itself up, nor does any self-respecting Unix/Linux version... Perhaps if /etc/nsswitch.conf is screwy a system might check DNS before looking at it's own files, but /etc/hosts is correct so it's a moot point.
127. is provided by DNS and for some DNS servers it's required but a forward zone to provide localhost is seldom provided and is never necessary.
I had the same issue and noticed that in my /etc/postfix/main.cf, there was an entry for
relayhost = localhost:25
Once I removed that entry, mail started working fine. I think when you specify a 'relay server', postfix assumes it is not local, and has to resolve through external DNS, queries the DNS server (as opposed to using nsswitch.conf to do /etc/hosts check before DNS) and I don't think any public dns server will provide a lookup for localhost.
Business Accounts
Answer for Membership
by: jleviePosted on 2003-09-20 at 07:56:33ID: 9398897
Can you do a 'host localhost' or 'nslookup localhost' and get the correct data?