Comment 2 for bug 1774540

Revision history for this message
Ryan Harper (raharper) wrote :

The searchpath is copied. In netplan , the config namespace is:

nameservers:
   - addresses: [x, y]
   - search: [a, b]

The relevant code in cloudinit/net/netplan.py:

# inject global nameserver values under each all interface which
# has addresses and do not already have a DNS configuration
if nameservers or searchdomains:
    nscfg = {'addresses': nameservers, 'search': searchdomains}
    for section in [ethernets, wifis, bonds, bridges, vlans]:
        for _name, cfg in section.items():
            if 'nameservers' in cfg or 'addresses' not in cfg:
                continue
            cfg.update({'nameservers': nscfg})

Note the nscfg contains both the nameservers and the searchdomains.