public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH container] fix #7156: setup: separate dns list with semicolons
@ 2025-12-17 15:06 Maximiliano Sandoval
  2025-12-17 21:31 ` Thomas Lamprecht
  2025-12-17 21:36 ` Thomas Lamprecht
  0 siblings, 2 replies; 6+ messages in thread
From: Maximiliano Sandoval @ 2025-12-17 15:06 UTC (permalink / raw)
  To: pve-devel

Network manager uses GLib's key file format [1]. As per `man 5
nm-settings-keyfile`:

> lists are separated by character ;

additionally, table 6 contains an example:

> Example: dns=1.2.3.4;8.8.8.8;8.8.4.4;

[1] https://docs.gtk.org/glib/struct.KeyFile.html

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---

Running `nmcli` with this patch on a new rockylinux 10 container results in 

```
DNS configuration:
        servers: 10.10.10.2 10.10.10.22
        domains: testinstall
        interface: eth0
```

and 
```
$ grep 'dns=' /etc/NetworkManager/system-connections/eth0.nmconnection
dns=10.10.10.2;10.10.10.22
```

and domain resolution seems to works as expected.


 src/PVE/LXC/Setup/CentOS.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/PVE/LXC/Setup/CentOS.pm b/src/PVE/LXC/Setup/CentOS.pm
index 0826977..7bccca2 100644
--- a/src/PVE/LXC/Setup/CentOS.pm
+++ b/src/PVE/LXC/Setup/CentOS.pm
@@ -244,7 +244,7 @@ sub setup_network_with_networkmanager {
                 }
             }
             if (@name_servers_v4) {
-                $data .= "dns=" . join(',', @name_servers_v4) . "\n";
+                $data .= "dns=" . join(';', @name_servers_v4) . "\n";
                 $data .= "dns-search=" . join(' ', PVE::Tools::split_list($searchdomains)) . "\n"
                     if $searchdomains;
             }
@@ -270,7 +270,7 @@ sub setup_network_with_networkmanager {
                 }
             }
             if (@name_servers_v6) {
-                $data .= "dns=" . join(',', @name_servers_v6) . "\n";
+                $data .= "dns=" . join(';', @name_servers_v6) . "\n";
                 $data .= "dns-search=" . join(' ', PVE::Tools::split_list($searchdomains)) . "\n"
                     if $searchdomains;
             }
-- 
2.47.3



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-12-18 15:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-17 15:06 [pve-devel] [PATCH container] fix #7156: setup: separate dns list with semicolons Maximiliano Sandoval
2025-12-17 21:31 ` Thomas Lamprecht
2025-12-17 21:36 ` Thomas Lamprecht
2025-12-18  8:21   ` Maximiliano Sandoval
2025-12-18 14:09     ` Thomas Lamprecht
2025-12-18 15:04       ` [pve-devel] superseded: " Maximiliano Sandoval

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal