Setting DNS for Debian cloud-init

foadk

Member
Mar 25, 2020
19
0
6
37
Hi.
I have a problem setting dns for my cloud init debian 10 image. This is the command I use:
qm set VMID --nameserver="4.2.2.4 8.8.4.4"
But I can't access the VM via ssh.
When I add nameservers manually to resolve.conf, it starts working.
I have this issue only for debian. It works fine for ubuntu and centos.
What could be causing the issue?
 
I think this because cloud-init setup dns configuration in /etc/network/interfaces.d/... and not in /etc/resolv.conf

ubuntu use "resolvconf" package (/etc/resolv.conf is a symlink).

maybe try to install resolvconf in your debian vm

https://bugs.launchpad.net/cloud-init/+bug/1850310