]> git.proxmox.com Git - pve-container.git/commitdiff
partially fix #3471: setup: centos: net: set DNS per iface config
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 29 Sep 2021 19:57:28 +0000 (21:57 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 29 Sep 2021 19:57:28 +0000 (21:57 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/LXC/Setup/CentOS.pm

index 4125c6871b976df0d2a8c1fcb94b6dfd3cde4bf2..e8dfc330dc7315ac5e436bae3df77758192b0896 100644 (file)
@@ -236,6 +236,14 @@ sub setup_network {
            }
        }
 
+       my ($searchdomains, $nameserver) = $self->lookup_dns_conf($conf);
+       my @nameservers = PVE::Tools::split_list($nameserver);
+
+       for my $i (0 .. $#nameservers) {
+           $data .= "DNS".($i+1)."=$nameservers[$i]\n";
+       }
+       $data .= "DOMAIN=".join(' ', PVE::Tools::split_list($searchdomains))."\n" if $searchdomains;
+
        next unless $data || $bootproto;
        $header .= "BOOTPROTO=$bootproto\n";
        $self->ct_file_set_contents($filename, $header . $data);