Proxmox 9 cloud-init and Debian 13 (Trixie) fails to set DNS

marcello.dimarino

New Member
Aug 31, 2025
1
1
1
Hello.

Debian 13 uses cloud-init version 25.1.4. This version uses a different structure to configure DNS servers.

Proxmox 9 cloud-init generate files from previous version that doesn't work to set DNS servers for Debian 13.

Hope Proxmox fix its file structure for cloud-init.

Thanks!
 
  • Like
Reactions: AkramiPro
same here

pve host

Code:
$ pveversion
pve-manager/9.0.6/49c767b70aeb6648 (running kernel: 6.14.11-1-pve)

Code:
$ qm cloudinit dump 100 network
version: 1
config:
    - type: physical
      name: eth0
      mac_address: 'xx:xx:xx:xx:xx:xx'
      subnets:
      - type: static
        address: '192.168.1.150'
        netmask: '255.255.255.0'
        gateway: '192.168.1.1'
    - type: nameserver
      address:
      - '9.9.9.9'
      - '8.8.8.8'
      search:
      - 'xyz.local'

Debian 13 vm

Code:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 13 (trixie)
Release:        13
Codename:       trixie

Code:
$ cloud-init --version
/usr/bin/cloud-init 25.1.4

Code:
$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

Code:
$ resolvconf --version
Debian resolvconf 1.94
Copyright:
  2003-2017 Thomas Hood <jdthood@gmail.com>
License: GPL-2+

Code:
$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug ens18
iface ens18 inet dhcp
# This is an autoconfigured IPv6 interface
iface ens18 inet6 auto

Code:
$ cat /etc/network/interfaces.d/50-cloud-init
# This file is generated from information provided by the datasource.  Changes
# to it will not persist across an instance reboot.  To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
auto lo
iface lo inet loopback
    dns-nameservers 9.9.9.9 8.8.8.8
    dns-search xyz.local

auto eth0
iface eth0 inet static
    address 192.168.1.150/24
    gateway 192.168.1.1

Code:
$ ip addr show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    altname enp0s18
    altname enxbc241100ffbc
    altname ens18
    inet 192.168.1.150/24 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fdf8:9a78:f086:e900:be24:11ff:fe00:ffbc/64 scope global dynamic mngtmpaddr proto kernel_ra
       valid_lft 7087sec preferred_lft 3487sec
    inet6 fe80::be24:11ff:fe00:ffbc/64 scope link proto kernel_ll
       valid_lft forever preferred_lft forever

Code:
$ cloud-init status --long
status: done
extended_status: done
boot_status_code: enabled-by-generator
last_update: Thu, 01 Jan 1970 00:00:25 +0000
detail: DataSourceNoCloud [seed=/dev/sr0]
errors: []
recoverable_errors: {}
 
I have had no problems using cloud-init in PVE9 to create a Debian 13 VM (server) based on the cloud image (https://cloud.debian.org/images/cloud/trixie/latest/debian-13-genericcloud-amd64.qcow2).
I should point out that I do not set any DNS settings, only user, password & NW/GW.

I suspect you weren't using a cloud image based on your output.
For example: In the created Debian Trixie VM, I get
Code:
root@Copy-of-VM-Debian-Trixie-CloudINIT-Template:~# resolvconf --version
systemd 257 (257.7-1)
+PAM +AUDIT +SELINUX +APPARMOR +IMA +IPE +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBCRYPTSETUP_PLUGINS +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK +BTF -XKBCOMMON -UTMP +SYSVINIT +LIBARCHIVE

However Proxmox is using an outdated version of Cloud-init, as if you set a User (possibly even if you don't) you will get a warning:
Code:
root@Copy-of-VM-Debian-Trixie-CloudINIT-Template:~# cloud-init status --long
status: done
extended_status: degraded done
boot_status_code: enabled-by-generator
last_update: Thu, 01 Jan 1970 00:00:08 +0000
detail: DataSourceNoCloud [seed=/dev/sr0]
errors: []
recoverable_errors:
DEPRECATED:
        - 'user' of type string is deprecated in 22.2 and scheduled to be removed in 27.2. Use 'users' list instead.
        - 'user' of type string is deprecated in 22.2 and scheduled to be removed in 27.2. Use 'users' list instead.

This has already been posted here.
 
  • Like
Reactions: proxuser77
I suspect you weren't using a cloud image based on your output.
Yep, that's what I suspect too.

Also, in the cloud image I'm using (https://cdimage.debian.org/cdimage/cloud/trixie/latest/debian-13-generic-amd64.raw) there's no /etc/network/interfaces.d/50-cloud-init file, but rather /etc/netplan/50-cloud-init.yaml, which looks like this in the VM:

YAML:
network:
  version: 2
  ethernets:
    eth0:
      match:
        macaddress: "xx:xx:xx:xx:xx:xx"
      addresses:
      - "192.168.220.116/24"
      nameservers:
        addresses:
        - 192.168.220.1
        search:
        - local.mydomain.tld
      set-name: "eth0"
      routes:
      - to: "default"
        via: "192.168.220.1"

And it seems to work:

Code:
root@trixie:/etc/cloud# resolvectl status
Global
         Protocols: +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
  resolv.conf mode: uplink

Link 2 (eth0)
    Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
         Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 192.168.220.1
       DNS Servers: 192.168.220.1
        DNS Domain: local.mydomain.tld
     Default Route: yes
root@trixie:/etc/cloud# resolvectl show-server-state 
Server: 192.168.220.1                        
                              Type: link
                         Interface: eth0
                   Interface Index: 2
            Verified feature level: UDP+EDNS0
            Possible feature level: UDP+EDNS0
                       DNSSEC Mode: no
                  DNSSEC Supported: yes
Maximum UDP fragment size received: 512
               Failed UDP attempts: 0
               Failed TCP attempts: 0
             Seen truncated packet: no
          Seen OPT RR getting lost: no
             Seen RRSIG RR missing: no
               Seen invalid packet: no
            Server dropped DO flag: no
 
So, for DNS configuration to apply correctly, the systemd-resolved package must be installed.
Yes, but as far as I understand it, that should already be pre-installed in the cloud images and then be used by Netplan by default. For me, at least, it worked out of the box without having to install the systemd-resolved package manually via virt-customize beforehand.
 
Last edited:
no it is not installed by default in debian cloud images
Then, it gets installed by default, at least with the Trixie RAW images, because it is installed in my Trixie test VM, and I definitely didn't install it via virt-customize or manually in the VM after it was up and running.

I create my test VMs via a script using qm create and qm importdisk, and the netweork setings are set like this:

Code:
qm set $VMID --nameserver 192.168.220.1
qm set $VMID --ipconfig0 ip=192.168.220.$VMID/24,gw=192.168.220.1

Im using the following Cloud Image: https://cdimage.debian.org/cdimage/cloud/trixie/latest/debian-13-generic-amd64.raw
 
Last edited:
The only difference possible, are you choosing to Update packages Yes within the cloud-init?