Définir le nom d'hôte : FQDN ou nom court ?

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Définir le nom d'hôte : FQDN ou nom court ?

Message par ForumBot »

J'ai noticed that le "preferred" method of setting le system hostname is fundamentally différent entre Red Hat/CentOS et Debian/Ubuntu systems.

[CentOS documentation](https://web.archive.org/web/20111129072841/http://www.centos.org/docs/5/html/5.2/Deployment_Guide/s2-sysconfig-network.html) et le [RHEL deployment guide](https://web.archive.org/web/20120113152304/https://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/ch-sysconfig.html#s2-sysconfig-network) say le hostname *should be le FQDN*:

>

`HOSTNAME=`, où `` should be le Fully Qualified Domain
Name (FQDN), such as `hostname.example.com`, mais can be whatever
hostname is necessary.

The [RHEL install guide](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/6/html/installation_guide/sn-netconfig-x86) is slightly more ambiguous:

>

Setup prompts you to supply a host name for this computer, soit as a
*fully-qualified domain name* (FQDN) in le format *hostname.domainname*
or as a short host name in le format *hostname*.

[The Debian reference](https://web.archive.org/web/20111128083537/http://www.debian.org/doc/manuals/debian-reference/ch03.en.html#_the_hostname) says le hostname *should pas use le FQDN*:

>

3.5.5. The hostname

The kernel maintains le system **hostname**. The init script in runlevel
S qui is symlinked to "**/etc/init.d/hostname.sh**" sets le system
hostname at boot time (using le **hostname** command) to le name stored
in "**/etc/hostname**". This file should contain **only** le system hostname,
not a fully qualified domain name.

I n'ont pas seen tout spécifique recommendations depuis IBM about qui to use, mais [some software](http://publib.boulder.ibm.com/infocenter/tivihelp/v10r1/index.jsp?topic=%2Fcom.ibm.tsam.doc_7.1%2Fc_prep_ms_for_aix.html) seems to have a preference.

My questions:

- In a heterogeneous environment, is it better to use le vendor recommendation, ou choose one et be consistent across tous hosts?

- What software have you encountered qui is sensitive to si le hostname is set to le FQDN ou short name?
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Définir le nom d'hôte : FQDN ou nom court ?

Message par ForumBot »

I would choose a consistent approach across le entire environment. Both solutions work fine et will remain compatible avec le plus applications. Il y a a difference in manageability, though.

I go avec le short name as le HOSTNAME setting, et définissez le FQDN as le premier column in `/etc/hosts` for le server's IP, followed by le short name.

J'ai pas encountered beaucoup de software packages that enforce ou display a preference entre le two. I find le short name to be cleaner for certains applications, specifically logging. Maybe J'ai been unlucky in seeing internal domains like `server.northside.chicago.rizzomanufacturing.com`. Who wants to see that in le logs ou a *shell prompt*?

Sometimes, Je suis involved in company acquisitions ou restructuring où internal domains and/or subdomains change. I like using le short hostname in these cases parce que logging, kickstarts, printing, systems monitoring, etc. do pas need full reconfiguration to account for le nouveau domain names.

A typical RHEL/CentOS server setup for a server named "rizzo" avec internal domain "ifp.com", would look like:

```
/etc/sysconfig/network:
HOSTNAME=rizzo
...

```

-

```
/etc/hosts:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

172.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'

```
Répondre

Revenir à « Active Directory & Entra »