linux – 设置主机名:FQDN还是短名称?

linux – 设置主机名:FQDN还是短名称?,第1张

概述我注意到设置系统主机名的“首选”方法在Red Hat / CentOS和Debian / Ubuntu系统之间根本不同. CentOS documentation和RHEL deployment guide说主机名应该是FQDN: HOSTNAME=<value>, where <value> should be the Fully Qualified Domain Name (FQDN), su 我注意到设置系统主机名的“首选”方法在Red Hat / CentOS和Debian / Ubuntu系统之间根本不同.

CentOS documentation和RHEL deployment guide说主机名应该是FQDN:

HOSTname=<value>,where <value> should be the Fully QualifIEd Domain
name (FQDN),such as hostname.example.com,but can be whatever
hostname is necessary.

RHEL install guide稍微含糊不清:

Setup prompts you to supply a host name for this computer,either as a
fully-qualifIEd domain name (FQDN) in the format hostname.domainname
or as a short host name in the format hostname.

The Debian reference表示主机名不应使用FQDN:

3.5.5. The hostname

The kernel maintains the system hostname. The init script in runlevel
S which is symlinked to “/etc/init.d/hostname.sh” sets the system
hostname at boot time (using the hostname command) to the name stored
in “/etc/hostname“. This file should contain only the system hostname,
not a fully qualifIEd domain name.

我没有看到IBM提出哪些具体建议,但some software似乎有偏好.

我的问题:

>在异构环境中,使用供应商建议或选择一个并在所有主机上保持一致是否更好?
>您遇到的哪个软件对主机名是设置为FQDN还是短名称很敏感?

解决方法 我会在整个环境中选择一致的方法.两种解决方案均可正常工作,并可与大多数应用程但是,可管理性存在差异.

我使用短名称作为HOSTname设置,并将FQDN设置为服务器IP的/ etc / hosts中的第一列,然后是短名称.

我没有遇到过许多强制执行或显示两者之间偏好的软件包.我发现短名称对某些应用程序更清晰,特别是日志记录.也许我看到像server.northsIDe.chicago.rizzomanufacturing.com这样的内部域名是不吉利的.谁想在日志或shell提示符中看到它?

有时,我参与公司收购或重组,内部域和/或子域名发生变化.我喜欢在这些情况下使用短主机名,因为日志记录,kickstart,打印,系统监控等不需要完全重新配置来考虑新域名.

具有内部域“ifp.com”的名为“rizzo”的服务器的典型RHEL / CentOS服务器设置如下所示:

/etc/sysconfig/network:HOSTname=rizzo...

/etc/hosts:127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4::1         localhost localhost.localdomain localhost6 localhost6.localdomain6172.16.100.13   rizzo.ifp.com rizzo

[root@rizzo ~]# hostname rizzo

/var/log/messages snippet:Dec 15 10:10:13 rizzo proftpd[19675]: 172.16.100.13 (::ffff:206.15.236.182[::ffff:206.15.236.182]) - Preparing to                chroot to directory '/app/upload/GREEK'Dec 15 10:10:51 rizzo proftpd[20660]: 172.16.100.13 (::ffff:12.28.170.2[::ffff:12.28.170.2]) - FTP session opened.Dec 15 10:10:51 rizzo proftpd[20660]: 172.16.100.13 (::ffff:12.28.170.2[::ffff:12.28.170.2]) - Preparing to chroot                to directory '/app/upload/ftp/SRRID'
总结

以上是内存溢出为你收集整理的linux – 设置主机名:FQDN还是短名称?全部内容,希望文章能够帮你解决linux – 设置主机名:FQDN还是短名称?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1045590.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存