77
votes
Accepted
Why does /etc/resolv.conf point at 127.0.0.53?
You are likely running systemd-resolved as a service.
systemd-resolved generates two configuration files on the fly, for optional use by DNS client libraries (such as the BIND DNS client library in C ...
40
votes
Accepted
What overwrites /etc/resolv.conf on every boot?
You shouldn't manually update your resolv.conf, because all changes will be overwritten by data that your local DHCP server provides. If you want it to be static, run sudo dpkg-reconfigure resolvconf ...
26
votes
Accepted
BOOTPROTO=none | static | dhcp and /etc/resolv.conf
If you read /etc/sysconfig/network-scripts/ifup-eth you'll see that networking uses DHCP if BOOTPROTO is set to dhcp or bootp, otherwise it's not used:
if ["${BOOTPROTO}" = "bootp" -o "${BOOTPROTO}" =...
25
votes
Accepted
Who reads /etc/resolv.conf?
DNS client libraries do.
C libraries contain DNS clients that wrap up name-to-address lookups in the DNS protocol and hand them over to proxy DNS servers to do all of the grunt work of query ...
15
votes
Accepted
I can resolve a *.local domain, ping the IP, but I can't ping this domain
I found the answer! So most of you will know that the /etc/hosts file will resolve domains, somewhat like a DNS server. But how does the system know to look in that file? And how does it know what ...
12
votes
What is the difference between resolvconf, systemd-resolve, and avahi?
When you run a command such as ping foobar the system needs to work out how to convert foobar to an ip address.
Typically the first place it looks is /etc/nsswitch.conf.
This might have a line such as:...
11
votes
Accepted
nameservers erased after systemctl restart network.service
You're probably mixing the classic /etc/init.d/network (which gets translated to network.service) with NetworkManager.service. While those are expected to partially coexist, it's much better to choose ...
10
votes
Accepted
How to setup DNS manually on Linux?
DNS Config Under Linux
DNS usage on linux is done over a set of routines in the C library that provide access to the Internet Domain Name System (DNS). The resolver configuration file (resolv.conf) ...
10
votes
Why does /etc/resolv.conf point at 127.0.0.53?
The entire 127.0.0.0/8 CIDR block is used for loopack routing. Your host seems to be (or at least seems to think it is) running its own DNS server on that specific loopback address.
Because loopback ...
9
votes
Accepted
How to enable nameserver recursion?
The DNS resolver will only move onto the other name servers if the first one returns an error (i.e SERVFAIL) or can't be reached. If the DNS server returns NXDOMAIN then the resolver considers that ...
9
votes
Accepted
CentOS7: Network Manager is using wrong search domain
After a few hours of poking around, I was able to resolve this. It turns out, this was being set via DHCP:
nmcli -f ip4 device show eth0
IP4.ADDRESS[1]: 172.31.53.162/20
IP4....
9
votes
Accepted
Dhclient not updating /etc/resolv.conf
Mint and other modern distros ship with mdns by default, which wraps the regular public DNS with a local "decentralized" wrapper which enables zeroconf support for your local network. Basically, a ...
9
votes
How do I specify the order that Network-Manager populates /etc/resolv.conf
Set ipv4.dns-priority of at least one of the profiles, to specify the relative order.
For example
nmcli connection modify "$PROFILE" ipv4.dns-priority 5
and reactivate the connection.
See ...
8
votes
What overwrites /etc/resolv.conf on every boot?
Ubuntu 16.04
If the network interfaces for your server instance is controlled by DHCP, the dhclient program will overwrite your /etc/resolv.conf file whenever the networking service is restarted.
You ...
8
votes
File /etc/resolv.conf deleted on every reboot, why or what?
In my experience, /etc/resolv.conf gets regenerated on boot, so any manual changes to it get reset.
To work around this, you can create /etc/resolv.conf.head (or .tail depending on which end of the ...
8
votes
Disable search option for resolv.conf
The solution is to set the search option in /etc/resolv.conf to:
search .
so /etc/resolv.conf would look like.
search .
nameserver 8.8.8.8
nameserver 4.2.2.2
8
votes
Accepted
What is the use of sortlist option in /etc/resolv.conf?
sortlist is used to move matching IP addresses in DNS responses to the front of the result list with the intention that applications will use them preferentially. It's a bit obsolete though. Nowadays ...
8
votes
What's the difference between /run/systemd/resolve/stub-resolv.conf and /run/systemd/resolve/resolv.conf?
Using resolv.conf instead of stub-resolv.conf will bypass a lot of systemd-resolved configuration, such as DNS answer caching, per-interface DNS configuration, DNSSec enforcement, etc.
Explanations:
...
7
votes
resolv.conf limited to six domains with a total of 256 characters
This question has been asked off and on since the 1990s. It's still the same answer.
As Jakub Jelinek of RedHat said 10 years ago, this limit is hardwired into the BIND DNS client library that is ...
7
votes
Accepted
Are keywords in resolv.conf case sensitive?
They are certainly case sensitive in the glibc resolver libraries. Note the use of strncmp (case sensitive compare) rather than strncasecmp (case insensitive compare) in the MATCH function within ...
7
votes
Accepted
Cannot rename resolv.conf file as root
As per your steps, you protected the file /etc/resolv.conf from being deleted/overwritten with chattr +i (immutable)
So, you won't be able to move it to another file without doing sudo chattr -i /...
7
votes
How to fix OpenVPN DNS leak
Sooo the answer is to carefully follow the always-on-point instructions from the ArchLinux wiki:
https://wiki.archlinux.org/index.php/OpenVPN#Update_systemd-resolved_script
and to append the ...
7
votes
Alpine Linux sometimes DNS is not resolved
tl;dr
Open file /etc/udhcpc/udhcpc.conf with a text editor.
If the file is missing you just have to create it (and probably its containing folder).
Append line
RESOLV_CONF=no
Done.
Found here: ...
7
votes
Who reads /etc/resolv.conf?
From the far better FreeBSD man page, resolv.conf:
The resolver configuration file contains information that is read by the
resolver routines the first time they are invoked by a process.
On a ...
7
votes
Accepted
Fedora 33: Use custom DNS addresses
resolvectl dns
Global:
Link 2 (enp2s0):
Link 3 (wlp1s0): 192.168.43.63
sudo resolvectl dns wlp1s0 8.8.8.8 4.4.4.4
resolvectl dns
Global:
Link 2 (enp2s0):
Link 3 (wlp1s0): 8.8.8.8 4.4.4.4
6
votes
Accepted
How to know where resolv.conf entries come from?
/etc/resolv.conf is built from pieces that are in the directory /run/resolvconf/interface (actual location on current Debian and Ubuntu) /etc/resolvconf/run/interface (old location, still existing via ...
6
votes
CentOS7: Network Manager is using wrong search domain
The /etc/resolv.conf file will always be overwritten when there is a change or update to the network. You can control what is written by editing files in the /etc/resolvconf/resolv.conf.d/ folder... ...
6
votes
What's the "right way" to effect changes in /etc/resolv.conf with /etc/resolv.conf.d in place?
The answer is simple, The resolv.conf.d folder exists in /etc/resolvconf/ and contains head/base/original and tail files.
each of them if edited will update the resolv.conf file in /etc/
lets say you ...
6
votes
Accepted
What is causing the changes in /etc/resolver/ on MacOS Sierra to be noticed
[It] is enough to only open it in vim and not even change anything (just exit), previously echoed changes will be applied.
I had to use sudo vim for that to work. Running it with my regular user had ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
resolv.conf × 185dns × 112
networking × 35
debian × 28
networkmanager × 26
linux × 22
ubuntu × 20
resolvconf × 20
systemd-resolved × 16
centos × 14
dnsmasq × 13
rhel × 12
dhcp × 12
vpn × 9
openvpn × 9
dhclient × 8
linux-mint × 6
systemd × 5
kali-linux × 5
network-interface × 5
arch-linux × 4
fedora × 4
resolution × 4
etc × 4
manjaro × 3