服务器主机名问题

服务器主机名问题

来自 WHM/CPANEL 的电子邮件

Your hostname (HOSTIT) could not be resolved to an IP address.
This means that /etc/hosts is not set up correctly, and/or there is
no dns entry for HOSTIT. Please be sure that the contents of
/etc/hosts are configured correctly, and also that there is a
correct 'A' entry for the domain in the zone file.

Some or all of these problems can be caused by /etc/resolv.conf
being setup incorrectly. Please check that file if you believe
everything else is correct.

You may be able to automatically correct this problem by using the
'Add an A entry for your hostname' option under 'Dns Functions' in
your Web Host Manager. 

主机文件:

cat /etc/hosts
127.0.0.1               localhost localhost.localdomain localhost4 localhost4.localdomain4
::1             localhost localhost.localdomain localhost6 localhost6.localdomain6
18.14.16.26           HOSTIT HOSTIT.co sqwb1 sqwb1.HOSTIT.co

和 DNS:我可以 ping HOSTIT.co 和 sqwb1.HOSTIT.co,它们转到正确的 IP

这可能是什么原因造成的?

答案1

您需要使用 FQDN 作为 CPanel 的主机名:

主机名是您的物理 Web 服务器在 Internet 上的名称。选择一个不会用于 cPanel 帐户、社会可接受(因为它将出现在邮件标题中)且是完全合格域名(FQDN — 这将包含 2 个点“.”)的主机名非常重要
...
FQDN 也必须用小写字母书写。您可以在主机名主页的说明标题下查看这些要求。

来源:http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/HOstname

相关内容