Configure resolv.conf

When it comes to managing nameserver information on your operating system, many distros have moved away from manually editing the /etc/resolv.conf file.

It’s often recommended to use network configuration instead. Be sure to verify the preferred method for your distro before making any edits to the resolv.conf file.

For a full list of keys, refer to the resolv conf module schema.

1#cloud-config
2manage_resolv_conf: true
3resolv_conf:
4  domain: example.com
5  nameservers: [8.8.8.8, 8.8.4.4]
6  options: {rotate: true, timeout: 1}
7  searchdomains: [foo.example.com, bar.example.com]
8  sortlist: [10.0.0.1/255, 10.0.0.2]