netplan error, unknown key nameservers

I have an error, but not a spelling error.

Here is my netplan config:

network: ethernets: ens32: addresses: [172.16.120.74/16] nameservers: addresses: [127.0.0.53, 172.16.1.5] renderer: networkd version: '2'

This displays the error:

Error in network definition //etc/netplan/99.clw_netcfg.yaml line 3 column 6: unknown key nameservers

Does anyone have any ideas?

1

1 Answer

Unfortunately the netplan error messages often lead you to look at the wrong line. Lay your netplan yaml file out like this and it should all work:

network: version: 2 renderer: networkd ethernets: ens32: addresses: - 172.16.120.74/16 nameservers: addresses: [127.0.0.53, 172.16.1.5]

Note that the '-' character of your IP address should be under the second d in addresses from the line above.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like