Ubuntu Desktop 22.04の名前解決の設定を確認します。
systemd-resolved.serviceの状態を確認する!
systemd-resolved.serviceが起動していることを確認します。
$ systemctl status systemd-resolved.service ● systemd-resolved.service - Network Name Resolution Loaded: loaded (/lib/systemd/system/systemd-resolved.service; enabled; vendor preset: enabled) Active: active (running) since Sat 2022-12-10 14:39:12 JST; 4h 11min ago Docs: man:systemd-resolved.service(8) man:org.freedesktop.resolve1(5) https://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers https://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients Main PID: 645 (systemd-resolve) Status: "Processing requests..." Tasks: 1 (limit: 18976) Memory: 8.9M CPU: 158ms CGroup: /system.slice/systemd-resolved.service └─645 /lib/systemd/systemd-resolved Dec 10 14:39:11 dpc011p1 systemd[1]: Starting Network Name Resolution... Dec 10 14:39:12 dpc011p1 systemd-resolved[645]: Positive Trust Anchors: Dec 10 14:39:12 dpc011p1 systemd-resolved[645]: . IN DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d Dec 10 14:39:12 dpc011p1 systemd-resolved[645]: Negative trust anchors: home.arpa 10.in-addr.arpa 16.172.in-addr.arpa 17.172.in-addr.arpa 18.172.in-addr.arpa 19.172.in-addr.arpa 20.172.in-addr.arpa 21.172.in-addr.arpa 22> Dec 10 14:39:12 dpc011p1 systemd-resolved[645]: Using system hostname 'dpc011p1'. Dec 10 14:39:12 dpc011p1 systemd[1]: Started Network Name Resolution. Dec 10 14:39:16 dpc011p1 systemd-resolved[645]: eno1: Bus client set default route setting: yes Dec 10 14:39:16 dpc011p1 systemd-resolved[645]: eno1: Bus client set DNS server list to: 10.1.20.1, 10.1.0.1 Dec 10 14:39:39 dpc011p1 systemd-resolved[645]: Clock change detected. Flushing caches.
名前解決の設定を確認する!
名前解決の設定を確認します。resolv.confは、以下固定で実際の設定がされているわけではありません。
$ cat /etc/resolv.conf # This is /run/systemd/resolve/stub-resolv.conf managed by man:systemd-resolved(8). # Do not edit. # # This file might be symlinked as /etc/resolv.conf. If you're looking at # /etc/resolv.conf and seeing this text, you have followed the symlink. # # This is a dynamic resolv.conf file for connecting local clients to the # internal DNS stub resolver of systemd-resolved. This file lists all # configured search domains. # # Run "resolvectl status" to see details about the uplink DNS servers # currently in use. # # Third party programs should typically not access this file directly, but only # through the symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a # different way, replace this symlink by a static file or a different symlink. # # See man:systemd-resolved.service(8) for details about the supported modes of # operation for /etc/resolv.conf. nameserver 127.0.0.53 options edns0 trust-ad search .
実際の設定は、以下を確認します。GUIで設定した値が、確認できるはずです。生成された設定ファイルなので、こちらで編集することはしないようにしましょう。
$ cat /run/systemd/resolve/resolv.conf # This is /run/systemd/resolve/resolv.conf managed by man:systemd-resolved(8). # Do not edit. # # This file might be symlinked as /etc/resolv.conf. If you're looking at # /etc/resolv.conf and seeing this text, you have followed the symlink. # # This is a dynamic resolv.conf file for connecting local clients directly to # all known uplink DNS servers. This file lists all configured search domains. # # Third party programs should typically not access this file directly, but only # through the symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a # different way, replace this symlink by a static file or a different symlink. # # See man:systemd-resolved.service(8) for details about the supported modes of # operation for /etc/resolv.conf. nameserver 10.1.20.1 nameserver 10.1.0.1 search .
おわりに
DNSリゾルバの設定は、もはや「/etc/resolv.conf」ではないことに注意しましょう。
関連記事
関連書籍(Amazon)