Debian 配置自定义 DNS

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


© CXPLAY 2024