想搭建一个DNS,但是发现自己本地先起了个53,端口被占用了。
网上搜了下。
How and why (not) to use the 127.0.0.53 nameserver //为什么Ubuntu要这么做。
https://www.youtube.com/watch?v=DtFjrJdnWAU

具体操作来自这里:
https://dyrnq.com/ubuntu-update-etc-resolve-conf/

第一步:

mkdir -p /etc/systemd/resolved.conf.d/
cat >/etc/systemd/resolved.conf.d/99-dns.conf << EOF
[Resolve]
DNS=180.76.76.76 8.8.8.8
EOF
ln -s -f /run/systemd/resolve/resolv.conf /etc/resolv.conf
systemctl daemon-reload && systemctl restart systemd-resolved.service && systemctl status -l systemd-resolved.service --no-pager
cat /etc/resolv.conf

第二步:

mkdir -p /etc/systemd/resolved.conf.d/
cat >/etc/systemd/resolved.conf.d/98-disable-127-53.conf << EOF
[Resolve]
DNSStubListener=no
EOF
systemctl daemon-reload && systemctl restart systemd-resolved.service && systemctl status -l systemd-resolved.service --no-pager

标签: none

添加新评论