Assumed DNS resolver bug under AlmaLinux 8 #118

Open
opened 2025-09-28 12:02:09 +02:00 by rosasurfer · 1 comment
rosasurfer commented 2025-09-28 12:02:09 +02:00 (Migrated from github.com)

See hetzneronline/installimage@e15b5eab57/functions.sh (L3000)

On a RHEL compatible OS /etc/resolv.conf is a file, not a symlink. On these OS installimage writes the DNS entries only to /etc/resolv.conf, not to the NetworkManager. If the NetworkManager reloads its profile it rewrites /etc/resolv.conf with the content of either /run/NetworkManager/resolv.conf or /run/NetworkManager/no-stub-resolv.conf.

Because installimage doesn't update those files the resulting /etc/resolv.conf is empty.
Effect: After first reload of the network profile DNS fails due to missing settings.

Observed on AlmaLinux 8.10 with provided OS images and installimage. From the code I conclude that other RHEL-compatible OS may be affected, too.

How to reproduce:

  • run a standard install of AlmaLinux 8
  • boot the system
  • change host settings and reload the network, e.g. by hostnamectl set-hostname my.domain.tld
  • now /etc/resolv.conf is wiped out and DNS fails

Snippet from /installimage.debug:

...
[14:33:48] # Setting up miscellaneous files
[14:33:48] :   --- /dev/null	2025-09-26 14:32:26.656481972 +0200
[14:33:48] :   +++ /installimage.Eps6S/hdd/etc/resolv.conf	2025-09-26 14:33:48.439918089 +0200
[14:33:48] :   @@ -0,0 +1,6 @@
[14:33:48] :   +### Hetzner Online GmbH installimage
[14:33:48] :   +# nameserver config
[14:33:48] :   +nameserver 185.12.64.1
[14:33:48] :   +nameserver 2a01:4ff:ff00::add:2
[14:33:48] :   +nameserver 185.12.64.2
[14:33:48] :   +nameserver 2a01:4ff:ff00::add:1
...

See https://github.com/hetzneronline/installimage/blob/e15b5eab572bbaa1773b9b0d1d9c3448995aa5af/functions.sh#L3000 On a RHEL compatible OS `/etc/resolv.conf` is a file, not a symlink. On these OS `installimage` writes the DNS entries only to `/etc/resolv.conf`, not to the NetworkManager. If the NetworkManager reloads its profile it rewrites `/etc/resolv.conf` with the content of either `/run/NetworkManager/resolv.conf` or `/run/NetworkManager/no-stub-resolv.conf`. Because `installimage` doesn't update those files the resulting `/etc/resolv.conf` is empty. Effect: After first reload of the network profile DNS fails due to missing settings. Observed on AlmaLinux 8.10 with provided OS images and `installimage`. From the code I conclude that other RHEL-compatible OS may be affected, too. How to reproduce: - run a standard install of AlmaLinux 8 - boot the system - change host settings and reload the network, e.g. by `hostnamectl set-hostname my.domain.tld` - now `/etc/resolv.conf` is wiped out and DNS fails Snippet from `/installimage.debug`: ``` ... [14:33:48] # Setting up miscellaneous files [14:33:48] : --- /dev/null 2025-09-26 14:32:26.656481972 +0200 [14:33:48] : +++ /installimage.Eps6S/hdd/etc/resolv.conf 2025-09-26 14:33:48.439918089 +0200 [14:33:48] : @@ -0,0 +1,6 @@ [14:33:48] : +### Hetzner Online GmbH installimage [14:33:48] : +# nameserver config [14:33:48] : +nameserver 185.12.64.1 [14:33:48] : +nameserver 2a01:4ff:ff00::add:2 [14:33:48] : +nameserver 185.12.64.2 [14:33:48] : +nameserver 2a01:4ff:ff00::add:1 ... ```
asciiprod commented 2025-10-06 15:18:34 +02:00 (Migrated from github.com)

Thank you for your report. This currently affects Alma/Rocky 8 and 19 images which now also use NetworkManager, while the required DNSx entries are only generated for 9:
https://github.com/hetzneronline/installimage/blob/master/network_config.functions.sh#L315

Thank you for your report. This currently affects Alma/Rocky 8 and 19 images which now also use NetworkManager, while the required DNSx entries are only generated for 9: https://github.com/hetzneronline/installimage/blob/master/network_config.functions.sh#L315
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DiamantTh/installimage#118
No description provided.