RHEL9 instance can't configure DNS

I’m using cloud-init to build my instances but I don’t appear to have any control over the network…

network:
version: 2
renderer: NetworkManager
ethernets:
eth0:
dhcp4: true
dhcp6: false
nameservers:
addresses:
- 10.51.2.11
- 10.51.2.12
- 10.254.225.1
search:
- cbl.local
- lxd
Is there way of prepending an additional DNS server to lxdbr0? or instance?

I think that if your network renderer is NetworkManager, then you use nmcli to make changes for your networking. NetworkManager will then create the netplan configuration for you.

In the end I right out the overriding settings into /etc/sysconfig/network-scripts/ifcfg-eth0 in a write_files section of cloud-init and it does what I need…

Shame there is no way of doing this inside the incusbr0 network settings…

It has not been crystal clear what you are trying to achieve.

  1. You mention RHEL9 instance. How do you get that? Did you make the image yourself? If so, care to share some info on how you created it?
  2. If you want to setup cloud-init to autoconfigure your instances with certain DNS settings, do say so. In fact it appears in the end that this was a cloud-init question.
  3. The RHEL9 instance is a custom, and a bit exotic. Could you first try this with a simpler case, like with images:fedora/40?

If you do not have yet incusbr0, you can create it now with

incus network create incusbr1 ipv4.address=10.10.10.1/24 ipv4.nat=true ipv6.address=none ipv6.nat=false

Then, stop the container, change the default Incus profile to use incusbr0, finally start the containers.

This would help you find out whether you have hard-coded lxdbr0 in your containers (they would fail to start).

Also, it is more pleasant to see IP addresses like 10.10.10.x.

The image is centos/9-Stream/cloud but from memory the ifcfg-eth0 file is created by the distromanager rather than by cloud-init. So my assumption has always been that for centos the cloud-init portion was a ‘work around’. :slight_smile:

cloud-init on this image is 23.4-19 which is pretty up to date…

I have a tight schedule so can’t play at the moment… hopefully soon…