服务器上的主机名问题

来自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

什么可能导致这个?

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

您的主机名是您的物理networking服务器在互联网上的名称。 select不会用于cPanel帐户的主机名是重要的,它是社会可接受的(因为它将显示在邮件标题中),并且是完全限定的域名(FQDN – 它将包含2个点“。”)。

FQDN也必须写成小写字母。 这些要求可以在说明标题下的主要主机名页面上查看。

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