
我剛剛將我的 Ubuntu 盒子升級到 Ubuntu 18.04 (Bionic Beaver),我的 DNS 停止工作。關於這個盒子的一個“有趣”的事情是我希望它運行dnsmasq
而不是運行systemd-resolved
,因為我在這個盒子上運行 Pi-Hole。我已經嘗試了很多事情,目前(我認為)重要的是:
/etc/NetworkManager/NetworkManager.conf
包含dns=dnsmasq
在該[main]
部分中。
我已經禁用systemd-resolved
:
sudo systemctl disable systemd-resolved.service
sudo service systemd-resolved stop
Pi-hole 似乎確實在運行:
chris@psi:/etc/systemd$ sudo pihole status
[✓] DNS service is running
[✓] Pi-hole blocking is Enabled
/etc/resolv.conf
是一個符號連結
chris@psi:~$ ls -l /etc/resolv.conf
lrwxrwxrwx 1 root root 27 Jun 10 14:55 /etc/resolv.conf -> /run/resolvconf/resolv.conf
並包含:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.
nameserver 127.0.0.1
然而,任何進行 DNS 查找的嘗試都會失敗:
chris@psi:~$ host pi-hole.net
;; connection timed out; no servers could be reached
還有一件奇怪的事。我造訪了 Pi-Hole 管理網站,但它說我在黑名單上只有 1 個網域(今天早上大約有 125K,在我把事情搞砸之前)。
我現在真的很苦惱——我似乎找不到任何好的 DNS 診斷工具(請告訴我您正在嘗試哪些 DNS 伺服器以及您在哪裡尋找 DNS 伺服器)或任何可以給我提示正在發生的事情的日誌檔案。
對於無知的人有什麼線索嗎?