linux – 在Ubuntu 10.04上,/ etc / hostname是否应该包含服务器的FQDN?

在Ubuntu 10.04上,/ etc / hostname是否应包含服务器的完全限定域名?

解决方法

不,只是主机名部分. According to Ubuntu’s man pages,/ etc / hostname应该只包含主机名的主机名部分,而不是FQDN:

THE FQDN

You can’t change the FQDN
(as returned by hostname –fqdn) or
the DNS domain name (as returned by
dnsdomainname) with this command. The
FQDN of the system is the name that
the resolver(3) returns for the host
name.

Technically: The FQDN is the name
gethostbyname(2) returns for the host
name returned by gethostname(2). The
DNS domain name is the part after the
first dot.

Therefore it depends on the
configuration (usually in
/etc/host.conf) how you can change
it. Usually (if the hosts file is
parsed before DNS or NIS) you can
change it in /etc/hosts.

NOTES

The address families hostname tries when looking up the FQDN,
aliases
and network addresses of the host are determined by the
configuration
of your resolver. For instance,on GNU Libc systems,the
resolver can
be instructed to try IPv6 lookups first by using the inet6
option in /etc/resolv.conf.

FILES

/etc/hosts /etc/hostname This file should only contain domain name and not the full FQDN.

相关文章

/etc/sysctl.conf这个目录主要是配置一些系统信息,/etc/sys...
1.作用 useradd或adduser命令用来建立用户帐号和创建用户的起...
它们都是多模式编辑器,不同的是vim 是vi的升级版本,它不仅...
不管是我们在安装软件还是监测软件的使用性能,我们都要随时...
装好Tomcat7后,发现除了本机能访问外界访问不了,岂有此理。...
修改防火墙配置需要修改 /etc/sysconfig/iptables 这个文件,...