When I connect to a network (e.g. home or work network), I have to manually enter the nameserver adresses in /etc/resolv.conf every time (I change to a new network). It used to be automatic. Any ideas how to change this back to automatic again ?
Asked
Active
Viewed 4,183 times
1
-
check /etc/dhclient.conf and go to the line starting with request, see if you can find domain-name-servers. – Baroudi Safwen Mar 28 '16 at 08:26
2 Answers
1
/etc/resolv.conf should be a symbolic link to /run/resolvconf/resolv.conf which is updated automatically by resolvconf when the network configuration changes. Your /etc/resolv.conf is probably a separate file.
Just check it with:
ls -l /etc/resolv.conf
Rename or delete this file and make a symbolic link to /run/resolvconf/resolv.conf
ln -s /run/resolvconf/resolv.conf /etc/resolv.conf
Greenonline
- 2,235
- 11
- 24
- 30
Oleg Bolden
- 1,687
- 14
- 14
-
-
sudo ln -s /etc/resolvconf/resolv.conf /etc/resolv.conf ln: failed to create symbolic link ‘/etc/resolv.conf’: File exists – Sonntex Syndicate Mar 01 '18 at 11:57
-
Sonntex Syndicate, you need to delete/rename existing `/etc/resolv.conf` file before creating a symolic link with the same filename. – Oleg Bolden Mar 01 '18 at 13:55
-
-
I tried that - renamed it to resolv.conf.backup - that also didn't work. But thanks. – Sonntex Syndicate Mar 02 '18 at 08:39
0
Change Default DNS 127.0.0.53 To your NEW DNS (Changes the default DNS automatically on reboot) In Terminal:
sudo rm -f /etc/resolv.conf
sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
sudo reboot
Stephen Rauch
- 3,091
- 10
- 23
- 26