7.4. 主机没有找到/不能决定 FQDN
RHN 配置文件完全依赖 FQDN 来将 RHN Satellite名转换为一个 IP 地址。当Red Hat Update Agent、Red Hat Network Registration Client 和 Apache Web server 出现问题的时候,如果显示了“主机没有找到”错误信息,这通常是由 FQDN 的问题造成的。如果 Web 服务器无法启动并出现“不能获得服务器的 FQDN”错误信息时,也很可能是由于这个问题造成的。
这个问题通常是由
/etc/hosts
文件造成的。您应该检查 /etc/nsswitch.conf
文件,这个文件定义了域名的解析和顺序。通常情况下, /etc/hosts
文件被首先检查,然后是网络信息服务(NIS),然后是 DNS。Apache Web server 要成功启动而且 RHN 客户应用程序可以正常工作,以上的方法中的一个必须可以被正确使用。
要解决这个问题,指定
/etc/hosts
文件中的内容。这个文件会类似于:
127.0.0.1 this_machine.example.com this_machine localhost.localdomain \ localhost
127.0.0.1 this_machine.example.com this_machine localhost.localdomain \ localhost
首先,在一个文本编辑器中删除错误的机器信息,如:
127.0.0.1 localhost.localdomain.com localhost
127.0.0.1 localhost.localdomain.com localhost
然后,保存这个文件并重新运行 RHN 客户应用程序或 Apache Web server。如果它们还无法正常运行,在文件中明确指定 Satellite 的 IP 地址,如:
127.0.0.1 localhost.localdomain.com localhost 123.45.67.8 this_machine.example.com this_machine
127.0.0.1 localhost.localdomain.com localhost
123.45.67.8 this_machine.example.com this_machine
使用实际的 Satellite IP 地址来替换这里的值。这么做可能会解决这个问题。请注意,如果指定了具体的 IP 地址,在机器获得一个新的地址时就需要更新这个文件。