0

I add new hostname to the /etc/resolve.conf but it reset after I reboot Raspberry pi.

# Generated by resolvconf
nameserver 8.8.8.8

OS is raspbian buster on raspberry pi 4.

Edit: I have to change my dns server because it has problems on the local network.

Lymia
  • 23
  • 1
  • 6
  • Did you add the hostname to the `/etc/dhcpcd.conf`? – M. Rostami Jan 31 '20 at 00:19
  • No i just set new hostname on the resolv.conf and don't know why it happen. – Lymia Jan 31 '20 at 00:21
  • This is normal Linux operation. Why do you think you have to change it? – Milliways Jan 31 '20 at 00:29
  • @Milliways My dns server has problems on the local network and i have to change dns server. – Lymia Jan 31 '20 at 00:32
  • DO NOT add detail in Comments; edit your question. "My dns server has problems on the local network" is meaningless. People will suggest solutions, but unless you clarify the problem may just waste your time. See [How to set up networking/WiFi](https://raspberrypi.stackexchange.com/a/37921/8697) [How to set up Static IP Address](https://raspberrypi.stackexchange.com/a/74428/8697) – Milliways Jan 31 '20 at 00:37
  • `# Generated by resolvconf` essentially means "don't edit this file by hand". – Dmitry Grigoryev Jan 31 '20 at 15:20

1 Answers1

1

You shouldn't manually update the resolv.conf, because all changes will be overwritten by data that your local DHCP server provides. Therefore, the network manager of Raspbian Buster has configured by /etc/dhcpcd.conf. Every configuration of this config file always is overwriting to other network config files on the OS.

All you need is that you should config your network by /etc/dhcpcd.conf as you want. In this case, follow this procedure:

nano /etc/dhcpcd.conf  

Then, add this line:

static domain_name_servers=4.2.2.4 8.8.8.8  

Before Raspbian Strech (I'm not sure enough), you could do that. It's some difference we have here and you must follow them to configure the network.

M. Rostami
  • 4,235
  • 1
  • 15
  • 34