cloud-init doesn't set dns search domains
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Expired
|
Undecided
|
Unassigned |
Bug Description
Hi,
I am doing this:
Host with Ubuntu 22.04, lxd 5.10-b392610 (snap), running several virtual machines as LXD containers (Ubuntu 22.04 as well).
I do use LXD profiles with cloud-init settings (packages, runcmd, ...) in the user.user_data of LXD profiles. works as expected.
Since I am using different hosts in different networks in different timezones I am setting these things (timezone, apt-proxy, users) with a cloud-init script in the user.vendor-data settings of the LXD default profile. Works as well for most settings, i.e. timezone, proxy, users.
But it does not work for setting the DNS search domain.
Neither
resolv_conf:
nameservers: ['..some..ip']
searchdomains:
- domain1
- domain2
nor
network:
version: 2
ethernets:
eth0:
match:
name: eth*
nameservers:
search: [fritz.box]
seem to work.
/etc/resolv.conf just has
nameserver 127.0.0.53
options edns0 trust-ad
search lxd
and /etc/systemd/
#Domains=
regards
> resolv_conf:
You don't want to use that module on Ubuntu 22.04. Note the distro list[1] doesn't contain Ubuntu as a supported distro.
> network:
Do I understand correctly that you put this network config in user.vendor-data?
Lxd uses a different key for network, see cloud-init. network- config in lxd's docs [2]. This should be better documented in cloud-init, which doesn't document network configuration of this datasource at all.
[1] https:/ /cloudinit. readthedocs. io/en/latest/ reference/ modules. html#resolv- conf /linuxcontainer s.org/lxd/ docs/master/ cloud-init/ #custom- network- configuration
[2] https:/