Debian 配置自定义 DNS
date
Aug 26, 2023
slug
debian-dns-setting
status
Published
tags
片段
Linux
Debian
summary
使用 resolvconf 配置 resolv.conf 并守护状态.
type
Post
- 安装软件包
resolvconf
:
apt install resolvconf
- 检查启动状态:
- 启动
esolvconf
并设置为自动任务.
systemctl status resolvconf.service
systemctl start resolvconf.service systemctl enable resolvconf.service
- 编辑 head 配置:
vim /etc/resolvconf/resolv.conf.d/head
插入自定义 NS 服务器:
nameserver 8.8.8.8 nameserver 8.8.4.4
- 更新 resolve.conf 并启动自动更新:
resolvconf --enable-updates resolvconf -u
- 检查 DNS 配置服务器状态:
nslookup example.com
- NetworkConfiguration - Debian Wiki (#Defining the (DNS) Nameservers)