1. Ubuntu/resolv.conf

resolv.confが上書きされるときにDNSを設定するにはどうすればよいですか?

https://qastack.jp/unix/128220/how-do-i-set-my-dns-when-resolv-conf-is-being-overwritten

DNSの制御を取り戻す

1.1. 20.04LTS

1.2. systemd-resolved

https://thr3a.hatenablog.com/entry/20180711/1531285176

Ubuntu 17.04以降ではsystemd-resolvedがデフォルトで動作しているため、/etc/resolv.confを書き換えても変更されない

$ cat /etc/systemd/resolved.conf 
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See resolved.conf(5) for details

[Resolve]
#DNS=
#FallbackDNS=
#Domains=
#LLMNR=no
#MulticastDNS=no
#DNSSEC=no
#DNSOverTLS=no
#Cache=no-negative
#DNSStubListener=yes
#ReadEtcHosts=yes

[Resolve]
DNS=8.8.8.8 8.8.4.4

で再起動して反映

systemctl restart systemd-resolved

1.3. NetworkManager

NetworkManagerが設定しているらしい。

3.ネットワークマネージャー:

構成ファイル

/etc/NetworkManager/*

DNSを無効にする

$ cat /etc/NetworkManager/conf.d/no-dns.conf
[main]
dns=none

1.4. DHCP オーバーライド

https://wiki.ubuntu.com/OverrideDNSServers

MoinQ: Ubuntu/resolv.conf (last edited 2020-12-05 00:16:22 by ToshinoriMaeno)