假设我选择“trinity”作为此服务器的主机名.
我想正确设置DNS记录.我需要反向DNS到www.example.com,因此www.example.com的CNAME似乎不合适.这是我的问题:
最好的做法是设置两条DNS记录(在我的情况下可能是两条A记录),一条用于www.example.com,一条用于trinity.example.com,两者都指向该服务器的IP地址? (或者,即使它不被接受为最佳实践,这是一个好主意吗?)
如果是这样,以下是适当的/ etc / hosts文件吗?
$cat /etc/hosts 127.0.1.1 trinity.local trinity 99.100.101.102 trinity.example.com trinity www.example.com
这个服务器是Linode,Linode的文档似乎暗示上述方法是最好的(如果我正确地阅读它们).这是相关部分.我粗犷的线条似乎适用于这里.
Update /etc/hosts
Next,edit your /etc/hosts file to resemble the following example,
replacing “plato” with your chosen hostname,“example.com” with your
system’s domain name,and “12.34.56.78” with your system’s IP address.
As with the hostname,the domain name part of your FQDN does not
necesarily need to have any relationship to websites or other services
hosted on the server (although it may if you wish). As an example,you
might host “www.something.com” on your server,but the system’s FQDN
might be “mars.somethingelse.com.”File:/etc/hosts
06001
The value you assign as your system’s FQDN should have an “A” record
in DNS pointing to your Linode’s IP address. For more information on
configuring DNS,please see our guide on configuring DNS with the
Linode Manager.
解决方法
如果您需要反向DNS,请联系您的ISP(Linode)并要求他们为您的IP地址设置适当的PTR记录.
没有要求PTR记录匹配A记录(或者实际上对于任何具有该名称的主机都存在:69.18.136.215反转到cl136-215.invision.net,它没有前向地址),所以您可以设置PTR名称以匹配A记录,CNAME或您想要的任何有效DNS名称.
1与所有规则一样,存在例外情况.你的情况听起来不像其中之一.