0

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?

  • Have you tried putting the renderer and version lines above the ethernets section? Also make sure your indentation is only using spaces not tabs. Run netplan generate --debug afterwards to see if you can get a more meaningful error message. – Arronical Jul 17 at 9:01
0

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.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.