今時の Linux resolve 解決編


さくっと名前解決してほしい

nameserver 127.0.0.53

  • グローバルとプライベートの名前解決が別れているとどっちかしか解決できない件
  • GlobalDNS=8.8.8.8 (安定感ある)
  • GlobalDNS=1.1.1.1 (使ってみよう)
  • GlobalDNS=4.4.4.4 (ns1-value-domain.com からの更新がめちゃ遅くて使えない)

DNS 確認

systemd-resolve --status

ちゃんと設定

  • プライベートなDNSがグローバルの名前解決をしてくれないとき
/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=1.1.1.1 8.8.8.8
FallbackDNS=1.1.1.1 8.8.8.8
#Domains=
#LLMNR=no
MulticastDNS=yes
#DNSSEC=no
#Cache=yes
#DNSStubListener=yes

リンク作って再起動

sudo ln -sfn /var/run/systemd/resolve/resolv.conf /etc/resolv.conf
sudo systemctl restart systemd-resolved

DNS 確認

systemd-resolve --status