
dns-options
接続名をmyname
次の値に変更することができますvalue
。
nmcli con modify myname ipv4.dns-options value
インタラクティブ モードを使用すると、何ができるかについての簡単な説明が表示されますdns-options
。
nmcli> describe ipv4.dns-options
=== [dns-options] ===
[NM property description]
Array of DNS options. NULL means that the options are unset and left at the default. In this case NetworkManager will use default options. This is distinct from an empty list of properties.
質問: フィールドの値dns-options
と目的は何ですかdns-option
?
答え1
NetworkManagerのソースツリーを少し掘り下げて(libnm-core/nm-setting-ip-config.c
そして探し出してNDOTS
)resolv.conf(5)
では、オプションは で設定できるオプションと同じように見えます/etc/resolv.conf
。たとえば、
-bash-4.2$ grep options /etc/resolv.conf
options rotate
options timeout:1
options attempts:3
答え2
@thrig の回答に賛成したいのですが、まだ十分な評判がありません。最近、DNS ローテーションとタイムアウトを設定する必要がありました。引用符を使用して、それらを 1 つのコマンドにリストする必要があることがわかりました。
nmcli con modify <interface_name> ipv4.dns-options "timeout:1 rotate"
次のように表示されます/etc/resolv.conf
:
# Generated by NetworkManager
nameserver 1.1.1.1
nameserver 8.8.8.8
options timeout:1 rotate