I do need some clarifications for resolv.conf handling on ubuntu 18.04.02 My host is configure to use the old interfaces files. But the interface itself is configured to use dhcp auto enp2s0 iface enp2s0 inet dhcp

dns searchlist is provided via dhcp an shown inside the lease as well.

Now there seems two additonal resolv.conf beside the /etc/resolv.conf or at least link bases.

for systemd resolvconf is written to use the /var/run/systemd/resolve/resolv.conf and create a symbolic link for this file as /etc/resolv.conf

but service resolvconf status says a warning that /run/resolvconf/resolv.conf should be the linkbase for /etc/resolv.conf

and by the way my hosts are not resolved anyway....

so what should be the master file ?

2 Answers 2


In Ubuntu 18.04 and later, the usual arrangement is:

ls -al /etc/resolv.conf
/etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf

If yours is not the same, I suggest that you do:

sudo rm -f /etc/resolv.conf
sudo ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf



A more extensive answer that I entirely owe @chili555 from another thread.

History (for future people who can't find the right thread for this problem): My problem was that somehow my resolv.conf file(s) seemed "corrupted" and I had no access to the internet (although I was able to connect to my router). Other articles suggested editing the resolv.conf file and adding


that did absolutely nothing for me since I wasn't able to save changes. The problem is a missing/wrong system link (or pointer).

What helped, in the end, was (and I repeat that is chili555's accomplishment, not mine):

1 - In the terminal do:

ls -al /etc/resolv.conf

The output should look like this: [...] /etc/resolv.conf -> /run/systemd/resolve/stub-resolv.conf

If it doesn't;

2 - do:

sudo rm -f /etc/resolv.conf
sudo ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

3 - do:


and check again ls -al /etc/resolv.conf, it should print out what I mentioned in 1. If not, you may have made a typo, in that case, repeat step 2.

If the output of ls -al /etc/resolv.conf only shows /etc/resolv.conf you mistyped -al, you forgot the "l" after the "-a" (happened to me the first time).

After another reboot and reconnection to my router, everything worked as expected.

(My distro is: Ubuntu 20.4.4)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .