|
发表于 2005-4-2 11:42:46
|
显示全部楼层
好象sendmail一般是一定会找DNS的。当然你可以让它不找DNS。参见:http://www.sendmail.org/faq/section3.html#3.22
一般情况下sendmail会乎略/etc/host。而去找DNS。也就是说,就算你在/etc/hosts里定义了hostname,你甚至可以ping到这个hostname,但sendmail却无法向hostname发信。因为,sendmail会走nslookup这条路。
你定义的hsotname必须能dig到,能nslookup到,才能sendmail。
例如:
- [johnny@host ~]$ /usr/sbin/sendmail -d0 < /dev/null
- Version 8.13.1
- Compiled with: DNSMAP HESIOD HES_GETMAILHOST LDAPMAP LOG MAP_REGEX
- MATCHGECOS MILTER MIME7TO8 MIME8TO7 NAMED_BIND NETINET NETINET6
- NETUNIX NEWDB NIS PIPELINING SASLv2 SCANF STARTTLS TCPWRAPPERS
- USERDB USE_LDAP_INIT
- ============ SYSTEM IDENTITY (after readcf) ============
- (short domain name) $w = host
- (canonical domain name) $j = host.comanche.com
- (subdomain name) $m = comanche.com
- (node name) $k = host.comanche.com
- ========================================================
- Recipient names must be specified
- [johnny@host ~]$ dig comanche.com any
- ; <<>> DiG 9.2.5 <<>> comanche.com any
- ;; global options: printcmd
- ;; Got answer:
- ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30703
- ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1
- ;; QUESTION SECTION:
- ;comanche.com. IN ANY
- ;; ANSWER SECTION:
- comanche.com. 86400 IN SOA localhost.comanche.com. host.comanche.com. 42 10800 900 604800 86400
- comanche.com. 86400 IN NS localhost.comanche.com.
- comanche.com. 86400 IN MX 10 mail.comanche.com.
- ;; ADDITIONAL SECTION:
- mail.comanche.com. 86400 IN A 192.168.88.88
- ;; Query time: 1 msec
- ;; SERVER: 127.0.0.1#53(127.0.0.1)
- ;; WHEN: Sat Apr 2 11:34:51 2005
- ;; MSG SIZE rcvd: 132
- [johnny@host ~]$ nslookup mail.comanche.com
- Server: 127.0.0.1
- Address: 127.0.0.1#53
- Name: mail.comanche.com
- Address: 192.168.88.88
复制代码 |
|