Skip to main content

Update

Update the systems DNS config:

$ osapi client network dns update \
--servers "1.1.1.1,2.2.2.2" \
--search-domains "foo.bar,baz.qux" \
--interface-name eth0

┏━━━━━━━━━━┳━━━━━━━━┳━━━━━━━┓
┃ HOSTNAME ┃ STATUS ┃ ERROR ┃
┣━━━━━━━━━━╋━━━━━━━━╋━━━━━━━┫
┃ server1 ┃ ok ┃ ┃
┗━━━━━━━━━━┻━━━━━━━━┻━━━━━━━┛

When targeting all hosts, a confirmation prompt is shown first:

$ osapi client network dns update \
--servers "1.1.1.1,2.2.2.2" \
--search-domains "foo.bar" \
--interface-name eth0 \
--target _all
This will modify DNS on ALL hosts. Continue? [y/N] y

┏━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━┓
┃ HOSTNAME ┃ STATUS ┃ ERROR ┃
┣━━━━━━━━━━╋━━━━━━━━╋━━━━━━━━━━━┫
┃ server1 ┃ ok ┃ ┃
┃ server2 ┃ failed ┃ disk full ┃
┗━━━━━━━━━━┻━━━━━━━━┻━━━━━━━━━━━┛

Target by label to update a group of servers:

$ osapi client network dns update \
--servers "1.1.1.1,2.2.2.2" \
--interface-name eth0 \
--target group:web

Flags

FlagDescriptionDefault
--serversList of DNS server IP addressesone of*
--search-domainsList of DNS search domainsone of*
--interface-nameName of the network interface to configure DNSrequired
-T, --targetTarget: _any, _all, hostname, or label (group:web)_any

*At least one of --servers or --search-domains must be provided.