Solaris中hostname引起的sendmail错误
Jul7 02:14:00 solaris sendmail: My unqualified host name (solaris) unknown; sleeping for retry
Jul7 02:14:01 solaris sendmail: My unqualified host name (solaris) unknown; sleeping for retry
Jul7 02:15:01 solaris sendmail: unable to qualify my own domain name (solaris) -- using short name
Jul7 02:15:01 solaris sendmail: unable to qualify my own domain name (solaris) -- using short name
上面是syslog中的sendmail的错误信息,从log中可以看出错误的原因是hostname和domainname的问题。由于sendmail默认先查找fully qualified hostname,从而得到domainname。但我设置hostname为solaris,sendmail没法得到完整主机名,只能使用solaris这个短主机名。这就是上面日志的出错信息的含义。
知道出错的原因,就知道如何解决问题的方法。在solaris中,我们只需修改/etc/hosts文件,加上完整主机名就可以了。例如,我原来的/etc/hosts文件内容如下:
::1 localhost
127.0.0.1 localhost
192.168.11.11 solaris loghost
修改成:
::1 localhost
127.0.0.1 localhost
192.168.11.11 solaris solaris.localhost.localdomainloghost
这样,solaris中的sendmail就不会出现上述错误。我们可以用sendmail命令查看是否成功:
% /usr/lib/sendmail -d0.1 -bt
-d0.1是debug的等级,-bt是地址测试,Version 8.14.1+Sun
Compiled with: DNSMAP LDAPMAP LOG MAP_REGEX MATCHGECOS MILTER MIME7TO8 MIME8TO7 NAMED_BIND NDBM NETINET NETINET6 NETUNIX NEWDB NIS
NISPLUS PIPELINING SCANF STARTTLS TCPWRAPPERS USERDB
USE_LDAP_INIT XDEBUG
============ SYSTEM IDENTITY (after readcf) ============
(short domain name) $w = solaris
(canonical domain name) $j = solaris
(subdomain name) $m =
(node name) $k = solaris
========================================================
WARNING: local host name (solaris) is not qualified; see cf/README: WHO AM I?
ADDRESS TEST MODE (ruleset 3 NOT automatically
invoked)
Enter
Jul7 03:59:54 solaris sendmail: My unqualified host name (solaris) unknown; sleeping for retry
Jul7 04:00:54 solaris sendmail: unable to qualify my own domain name (solaris) -- using short
name
修改后:
Version 8.14.1+Sun
Compiled with: DNSMAP LDAPMAP LOG MAP_REGEX MATCHGECOS MILTER MIME7TO8
MIME8TO7 NAMED_BIND NDBM NETINET NETINET6 NETUNIX NEWDB NIS
NISPLUS PIPELINING SCANF STARTTLS TCPWRAPPERS USERDB
USE_LDAP_INIT XDEBUG
============ SYSTEM IDENTITY (after readcf) ============
(short domain name) $w = solaris
(canonical domain name) $j = solaris.localhost.localdomain
(subdomain name) $m = localhost.localdomain
(node name) $k = solaris
========================================================
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter
>
另外,我们还可以用以下的脚本进行测试:
/usr/lib/mail/sh/check-hostname
修改前:
Hostname solaris could not be fully qualified.
We recommend changing the /etc/hosts entry:
192.168.11.11 solaris loghost
to:
192.168.180.10 solaris solaris.localhost.localdomain loghost
修改后:
Hostname solaris OK: fully qualified as solaris.localhost.localdomain
参考:
http://www.unix.com/unix-for-dummies-question-and-answers/8657-dmesg-on-a-sun-unqualified-host.html
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/42898/showart_335669.html
页:
[1]