5

I cannot use apt update as every reboot my sudo vim /etc/resolv.conf file resets to the below

# Generated by resolvconf
search home
nameserver 127.0.0.1

I have tried to change the nameserver to a proper DNS but it resets every reboot? How can I fix this?

eekfonky
  • 243
  • 2
  • 5
  • 13

2 Answers2

3

As written in the first line of /etc/resolv.conf it is generated by resolvconf. If you want to set a static domain name server you have to uncomment in /etc/dhcpcd.conf the line:

#static domain_name_servers=192.168.0.1 8.8.8.8 fd51:42f8:caae:d92e::1

and set it to your name server and reboot. Maybe you have also to stop asking for a domain name server from your dhcp server. You can try to modify the line:

option domain_name_servers, domain_name, domain_search, host_name

to

option domain_name, domain_search, host_name
Ingo
  • 42,961
  • 20
  • 87
  • 207
0
  1. Open the following file:

    $ sudo vim /etc/resolvconf/resolv.conf.d/base

  2. Put your nameserver list in the file like those:

    nameserver 8.8.8.8 nameserver 8.8.4.4

  3. Update resolvconf with the following command:

    $ sudo resolvconf -u