= Ubuntu/resolv.conf = <> {{{ resolv.confが上書きされるときにDNSを設定するにはどうすればよいですか? }}} https://qastack.jp/unix/128220/how-do-i-set-my-dns-when-resolv-conf-is-being-overwritten DNSの制御を取り戻す == 20.04LTS == /etc/resolvconf は存在しない。 dnsmasq もない。 == 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 }}} == NetworkManager == NetworkManagerが設定しているらしい。 {{{ 3.ネットワークマネージャー: 構成ファイル /etc/NetworkManager/* DNSを無効にする $ cat /etc/NetworkManager/conf.d/no-dns.conf [main] dns=none }}} == DHCP オーバーライド == https://wiki.ubuntu.com/OverrideDNSServers