Skip to content

[Azure] User's customized dns search domains is over-written as re-config network on every boot #4065

@ubuntu-server-builder

Description

@ubuntu-server-builder

This bug was originally filed in Launchpad as LP: #2003048

Launchpad details
affected_projects = []
assignee = None
assignee_name = None
date_closed = 2023-01-30T16:58:52.245171+00:00
date_created = 2023-01-17T07:50:43.655101+00:00
date_fix_committed = None
date_fix_released = None
id = 2003048
importance = undecided
is_complete = True
lp_url = https://bugs.launchpad.net/cloud-init/+bug/2003048
milestone = None
owner = huijuanzhao
owner_name = Huijuan Zhao
private = False
status = wont_fix
submitter = huijuanzhao
submitter_name = Huijuan Zhao
tags = []
duplicates = []

Launchpad user Huijuan Zhao(huijuanzhao) wrote on 2023-01-17T07:50:43.655101+00:00

Description of problem:
This issue only exists on Azure cloud-init.
With the 22.1 version, we add dns search domains via nmcli con modify 'System eth0' +ipv4.dns-search domain.tld, after reboot, the config is over-written by cloud-init(the changes to /etc/sysconfig/network-scripts/ifcfg-eth0 get deleted, they used to be persistent), as Azure apply networking config on every BOOT[1] since cloud-init-22.1

[1] #1023

But some users prefer to persist the customized network config(e.g. DNS) after reboot, so could you please help to check how to enhance this patch[1] to meet customer's requirement[2]?

[2] User's requirements:
We add additional search domains to certain servers, mostly because they communicate with legacy urls in our company without using fqdn.

Additional info:
Below[3] is a workaround to persist user's customized DNS. But as all the customized network configs will be over-written after reboot, so maybe we need to consider how to avoid it.

[3] Adding the customized DNS to /etc/dhcp/dhclient.conf,
e.g.
Modify /etc/dhcp/dhclient.conf
timeout 300;
append domain-search "searchdomain1.com";
append domain-search "searchdomain2.com";
append domain-name-servers 1.1.1.1;

Reboot the VM and then check the dns information, the modifications are not overwritten.

cat /etc/resolv.conf

Generated by NetworkManager

search searchdomain1.com searchdomain2.com
nameserver 1.1.1.1

Test Veision: 22.1

How reproducible:
Modify dns search domains, reboot

Steps to Reproduce:

  1. nmcli con modify 'System eth0' +ipv4.dns-search example.com
  2. systemctl reboot

Actual results:
$ grep example.com /etc/resolv.conf
[No result]

Expected results:
$ grep example.com /etc/resolv.conf
search example.com

Metadata

Metadata

Assignees

No one assigned

    Labels

    launchpadMigrated from Launchpad

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions