Rocky 10 template and resolv.conf incomplete

Glowsome

Renowned Member
Jul 25, 2017
192
74
93
53
The Netherlands
www.comsolve.nl
Hi all,

I might have overlooked if this was posted before, but just wanted to share.
But when deploying a new LXC with the rocky10 (20251001) -template, the following is experienced when setting it to use host dns domain and server:

- /etc/resolv.conf is only populated with the searchdomain.
Code:
# Generated by NetworkManager
search mydomain.tld

Manually adding a/the dns servers sticks until a reboot is performed, then again as above only the searchdomain is present in it.

After some searching i have found a workaround, by introducing a configuration-file in /etc/NetworkManager/conf.d/

00-dns.conf

Code:
[main]
dns=none

Then the resulting /etc/resolv.conf is filled correctly:
Code:
# --- BEGIN PVE ---
search mydomain.tld
nameserver x.x.x.x
nameserver y.y.y.y
# --- END PVE ---

Questions i have:
Is this a template -issue, a general Rocky10 change in how NetworkManager works, or maybe a/the way in which ProxMox injects these settings ?

- Glowsome

Update: similar behavior is seen when a Rocky 9 to 10 migration/upgrade is performed.
 
Last edited:
Hi, we face the same issue.

and i can confirm the above mentioned workaround is working.
(we currently apply it via a hook-script - i wonder if this just works by accident?)

to me - the actual issue - looks like to be related to having multiple DNS servers configured.
we see the following in NetworkManager log:


Dec 17 12:52:23 <host> NetworkManager[164]: <warn> [1765975943.7659] keyfile: ipv4.dns: ignoring invalid DNS server IPv4 address '10.0.0.1,10.0.0.2'

checking /etc/NetworkManager/system-connections/eth0.nmconnection...
Code:
[connection]
...
method=manual
addresses=10.x.x.x/32
dns=10.0.0.1,10.0.0.2
...
... looks 'wrong' as the separator should be a ; instead of a ,
 
Last edited:
  • Like
Reactions: Glowsome
Hi, we face the same issue.

and i can confirm the above mentioned workaround is working.
(we currently apply it via a hook-script - i wonder if this just works by accident?)

to me - the actual issue - looks like to be related to having multiple DNS servers configured.
we see the following in NetworkManager log:


Dec 17 12:52:23 <host> NetworkManager[164]: <warn> [1765975943.7659] keyfile: ipv4.dns: ignoring invalid DNS server IPv4 address '10.0.0.1,10.0.0.2'

checking /etc/NetworkManager/system-connections/eth0.nmconnection...
Code:
[connection]
...
method=manual
addresses=10.x.x.x/32
dns=10.0.0.1,10.0.0.2
...
... looks 'wrong' as the separator should be a ; instead of a ,
On my end i have deployed my workaround via Ansible:
Code:
- name: Place override for NetworkManager and resolv.conf
  ansible.builtin.copy:
    content: |
      [main]
      dns=none
    dest: /etc/NetworkManager/conf.d/00-dns.conf
  when:
    - ansible_virtualization_type == "lxc"
    - ansible_pkg_mgr == "dnf" # i use RockyLinux LXC containers, so tailored the task to this
  register: resolv_override

- name: Reboot after NetworkManager change
  ansible.builtin.reboot:
  when:
    - ansible_virtualization_type == "lxc"
    - ansible_pkg_mgr == "dnf"
    - resolv_override.changed

It's a raw /quick implementation, it can be streamlined further, but i wanted to make sure conditions are met when the task(s) run.

- Glowsome
 
Last edited: