使用dnsmasq替换systemd-resolved

不打算折腾兼容,干脆直接换掉systemd-resolved了

sudo systemctl stop systemd-resolved
sudo systemctl disable systemd-resolved
sudo apt install dnsmasq

告诉NetworkManager用谁来解析ns

nano /etc/NetworkManager/NetworkManager.conf 

[main]

# use dnsmasq instead of systemd-resolved
dns=dnsmasq

并重启sudo systemctl restart NetworkManager

调整dnsmasq配置文件

mv /etc/resolv.conf /etc/resolv.conf.bak
ln -s /var/run/NetworkManager/resolv.conf /etc/resolv.conf

可对指定的根域名指定解析dns,大多用在内网的域
dnsmasq.conf

server=114.114.114.114
server=8.8.8.8
server=/chaitin.page/25.25.0.2

你可能感兴趣的:(使用dnsmasq替换systemd-resolved)