From 0fb453ebd0b6bd398bbade6572bf73aefd9c6544 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 10 Dec 2025 10:03:47 +0900 Subject: [PATCH] hostname: explain a bit why hostnames should be single DNS labels, not fqdns (cherry picked from commit 4362d942c4e1bcefb76e928e2f42ebe207a4ed03) --- man/hostname.xml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/man/hostname.xml b/man/hostname.xml index 76acb8d7a5c..20f00057fdc 100644 --- a/man/hostname.xml +++ b/man/hostname.xml @@ -38,10 +38,12 @@ The file should contain a single newline-terminated hostname string. Comments (lines starting with a #) are ignored. The hostname should be composed of up to 64 7-bit ASCII lower-case - alphanumeric characters or hyphens forming a valid DNS domain name. It is recommended that this name - contains only a single label, i.e. without any dots. Invalid characters will be filtered out in an - attempt to make the name valid, but obviously it is recommended to use a valid name and not rely on this - filtering. + alphanumeric characters or hyphens forming a valid DNS domain name. It is strongly recommended that this + name contains only a single DNS label, i.e does not contain any dots. This recommendation reflects both + usual expectations of applications, and the fact that the Linux kernel limits the length of the system + hostname to 64 (i.e. close to the maximum DNS label length of 63) rather than 255 (the maximum DNS domain + name length). When applied, invalid characters will be filtered out in an attempt to make the name valid, + but obviously it is recommended to use a valid name and not rely on this filtering. If the question mark character ? appears in the hostname, it is automatically substituted by a hexadecimal character derived from the