Where should I configure DNS in Debian 11?
7
votes
2
answers
72247
views
I'm using Debian 11 (Bullseye). I'd like to use a different DNS server. I found the file
/etc/resolv.conf
. It looks like this (by default):
nameserver 192.168.1.1
nameserver 1.1.1.1
nameserver 8.8.8.8
Fair enough default. Use the local router/gateways DNS, then Cloudflare, followed by Google's DNS. There is a second file, too, though - /etc/network/interfaces
. For me, where is what it looks like by default (I'm using DHCP)
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug enp4s0f0
iface enp4s0f0 inet dhcp
In that file, I can set my preferred DNS there by saying this, if I wanted to use, say, [quad9](https://www.quad9.net/) for my DNS.
dns-nameservers 9.9.9.9
So, if I'd like to change my DNS server, which file do I need to edit? Just one? Both?
Asked by cocomac
(545 rep)
Jan 9, 2022, 03:34 AM
Last activity: Mar 18, 2024, 11:31 PM
Last activity: Mar 18, 2024, 11:31 PM