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 ...
user avatar
  • 62.9k
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 ...
user avatar
  • 2,805
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}" =...
user avatar
  • 31.9k
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 ...
user avatar
  • 62.9k
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 ...
user avatar
  • 435
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:...
user avatar
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 ...
user avatar
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) ...
user avatar
  • 12.9k
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 ...
user avatar
  • 68.6k
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 ...
user avatar
  • 1,901
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....
user avatar
  • 1,006
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 ...
user avatar
  • 7,073
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 ...
user avatar
  • 1,286
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 ...
user avatar
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 ...
user avatar
  • 2,737
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
user avatar
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 ...
user avatar
  • 41.4k
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: ...
user avatar
  • 286
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 ...
user avatar
  • 62.9k
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 ...
user avatar
  • 20.5k
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 /...
user avatar
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 ...
user avatar
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: ...
user avatar
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 ...
user avatar
  • 1,739
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
user avatar
  • 2,143
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 ...
user avatar
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... ...
user avatar
  • 1,434
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 ...
user avatar
  • 247
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 ...
user avatar
  • 65k

Only top scored, non community-wiki answers of a minimum length are eligible