我将 WHM/cPanel 安装移至新服务器。更改名称服务器 IP 后,过了一会儿,域开始指向新服务器。

但是主机名不会解析为 IP 地址。

/scripts/ipcheck --verbose


IMPORTANT: Do not ignore this email.

Your hostname (xxx.example.com) 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 xxx.example.com. 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.

我跑:

nano /etc/hosts


# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
XXX.XXX.XXX.XXX         xxx.example.com xxx

我还检查:

nano /etc/resolv.conf

nameserver 8.8.8.8
nameserver 8.8.4.4

还:

nano /etc/nameserverips

XXX.XXX.XXX.XXX=ns1.example.com
XXX.XXX.XXX.XXX=ns2.example.com

我检查了 WHM 中的“为您的主机名添加一个条目”:

Hostname | Server Main IP
xxx.example.com | XXX.XXX.XXX.XXX

我检查并重建了 dnsconfig

/scripts/rebuildingdnsconfig

我真的不知道还要检查什么,我已经重新启动了服务器。指向名称服务器的域工作正常。我遇到的问题是我通过以下方式路由所有 cpanel 访问和电子邮件的 SSL 配置 https://xxx.example.com 因为它有 SSL 证书。我将这些设置与旧服务器进行了比较,除了 IP 地址之外,它们都是相同的。

CENTOS 6.4 WHM 11.40.0构建19

  • XXX.XXX.XXX = 服务器 IP
  • xxx.example.com = 主机名

任何帮助,将不胜感激。

有帮助吗?

解决方案

解决了这一点:

转到whm,“为您的主机名添加一个条目”,再次提交。

即使它正确地提交它也会再次工作。此修复来自CPANEL支持。

其他提示

我知道这是一篇旧帖子,但如果有人将来可能需要帮助解决类似问题,那么除了上述之外,这里还有一些检查点:

1>检查内容

/etc/wwwacct.conf

2> 调查您的主机名和 NS 以获得正确的结果

dig ns1.example.com
dig hostname.exmple.com
host ns1.example.com
host (HOST IP)
nslookup hostname.exmple.com

3) 确保您已在域名注册商处注册了 hostname.example.com 和 ns1.example.com,并且它们指向正确的 IP。

4) 确保没有防火墙阻止端口 UDP:53 和其他重要港口。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top