Debian 12 cloud image search domain missing? Yeah, it’s a thing. The cloud image doesn’t set one, so your VMs can’t resolve short hostnames. Annoying, but easy to fix with cloud-init.

Why the search domain is missing
The Debian 12 generic cloud image ships with a minimal cloud-init config. It sets the hostname and IP, but the search domain field is left empty. Proxmox passes the domain via DHCP or cloud-init, but the image ignores it unless you explicitly tell it to write the setting.
Check it yourself: boot the VM, then run cat /etc/resolv.conf. You’ll see your nameserver but no search line. That’s the gap.

The fix: cloud-init network config
You need to tell cloud-init to write the search domain. The clean way is a user-data snippet in Proxmox. Here’s the flow:
- In Proxmox, go to your VM’s Cloud-Init tab.
- Set the DNS domain field to your domain (e.g.,
home.lan). - Add a Cloud-Init drive if you don’t have one.
- Regenerate the image and reboot the VM.
But sometimes that still doesn’t stick. The Debian image’s cloud-init config may not map the Proxmox domain field to the network config. In that case, you need to pass it explicitly via user-data.
Create a snippet in Proxmox storage or use the cicustom option:
#cloud-config
network:
version: 2
ethernets:
ens18:
dhcp4: true
nameservers:
search: [home.lan]
Then attach it to the VM with qm set <vmid> --cicustom "user=local:snippets/cloudinit.yaml". Replace ens18 with your actual interface name.
Test it
After reboot, run resolvectl status or cat /etc/resolv.conf. You should see the search domain listed. Try pinging a short hostname like ping router — it should resolve.
If it still doesn’t work, check that cloud-init actually ran with cloud-init status. If it says done but no search domain, your snippet might not be applied. Double-check the cicustom path and the YAML indentation.
This is one of those things where Proxmox and Debian just don’t talk to each other right. The fix is a few lines of YAML, but it’s not obvious unless you’ve hit it before. Now you know.
Related: Is it possible to have a Proxmox VM image? Yes, here’s how