Cannot override nameservers, only append to list

Bug #1827730 reported by Jouni K. Seppänen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Netplan
New
Undecided
Unassigned

Bug Description

The netplan reference states:

> Lexicographically later files (regardless of in which directory they are)
> amend (new mapping keys) or override (same mapping keys) previous ones.

On a freshly installed Ubuntu 18.04 server on DigitalOcean, cloud-init creates a configuration file `/etc/netplan/50-cloud-init.yaml`, which includes something like this:

```
network:
    ethernets:
        eth0:
            nameservers:
                addresses:
                - 8.8.8.8
                - 8.8.4.4
                search: []
```

I created my own configuration file, with a lexicographically later name and the same mapping keys with different values:

```
network:
    ethernets:
        eth0:
            nameservers:
                addresses:
                - 9.9.9.9
```

The result was that `systemd-resolve --status` listed the union of the nameserver lists for `eth0` instead of only the latter ones. Thus while the mapping key was the same, the values didn't override the previous ones but amended them.

Some discussion at https://askubuntu.com/questions/1070278/how-can-i-override-netplans-per-interface-nameservers-rather-than-appending-to

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.