On Mon, 2021-02-22 at 11:14 -0600, Michael Catanzaro wrote:
On Mon, Feb 22, 2021 at 5:46 pm, Tomasz Torcz
<tomek(a)pipebreaker.pl>
wrote:
> But "dns = none" seems wrong.
Well it would be the right choice if cloud-init were to manually
configure a static list of DNS servers in /etc/systemd/resolved.conf
(or, previously, /etc/resolv.conf), which is probably what you want
for
a cloud server.
Yes, cloud-init configures NetworkManager to not manage DNS if it has
DNS servers that it configures statically:
This is the relevant code snippet:
def _render_networkmanager_conf(network_state, templates=None):
content = networkmanager_conf.NetworkManagerConf("")
# If DNS server information is provided, configure
# NetworkManager to not manage dns, so that /etc/resolv.conf
# does not get clobbered.
if network_state.dns_nameservers:
content.set_section_keypair('main', 'dns', 'none')
Source:
https://github.com/canonical/cloud-init/blob/66e2d42dd1b722dc8e59f4e5990c...