From 95053c1cc4d525b5a1a62ac5334c9ff6b0593fa4 Mon Sep 17 00:00:00 2001 From: sjugge Date: Sat, 28 Mar 2026 18:37:00 +0100 Subject: [PATCH] connman: DHCP hostname update config --- src/config/network/connman.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/config/network/connman.md b/src/config/network/connman.md index 031300c8b..79311180f 100644 --- a/src/config/network/connman.md +++ b/src/config/network/connman.md @@ -48,3 +48,33 @@ Create `/etc/sv/connmand/conf` with the following content: ``` OPTS="--nodnsproxy" ``` + +## Prevent ConnMan from updating hostname + +[`connman.conf`](https://man.voidlinux.org/connman.conf) will by default allow +ConnMan to update the system hostname, for example when a hostname is received +from DHCP. + +ConnMan will update the value in `/proc/sys/kernel/hostname`. This can lead to a +situation where ConnMan receives a stale hostname value from a DHCP server but +`/etc/hostname`, `/etc/rc.conf`, etc contain the user configured hostname, +conflicting with the value in `/proc/sys/kernel/hostname`. Applications and +processes may obtain a hostname from different sources leading to +inconsistencies. + +To disallow ConnMan from updating the system hostname, create +`/etc/connman/main.conf` with the following configuration. + +``` +[General] +AllowHostnameUpdates = false +AllowDomainnameUpdates = false +``` + +If ConnMan set an undesired value in `/proc/sys/kernel/hostname`, ensure the +configuration above is applied and the service restarted. And update to the +preferred value. + +``` +# echo "" > /proc/sys/kernel/hostname +```