在debian上配置dns服务
05 November 2024
在debian上配置DNS服务
# make sure installed resolvconf program
apt update
apt upgrade
apt install resolvconf
# Check if the program has already started
systemctl status resolvconf.service
# if not "active", activate the service
systemctl start resolvconf.service
systemctl enable resolvconf.service
systemctl status resolvconf.service
Next, customize the head document of this service: nano /etc/resolvconf/resolv.conf.d/head, add the following IP addresses:
nameserver 8.8.8.8
nameserver 8.8.4.4
Lastly, update the resolv.conf file. To do this, use the following command:
resolvconf --enable-updates
resolvconf -u
And Now, you can check the resolv.conf file changed.
nano /etc/resolv.conf
参考: How to set your DNS server on Debian in the network settings
Debian NetworkConfiguration
