The "resolv.conf" file becomes empty after each restart

49,785

That file has 2 comments in it:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

Why not listen to the people that made/maintain this file? ;-)

resolveconf

From the man page:

Normally the resolvconf program is run only by network interface con‐ figuration programs such as pppd(8) (for ppp interfaces); by DHCP clients such as dhclient(8); by ifup(8) and ifdown; and by DNS caches such as dnsmasq(8) (for the loopback interface). These programs obtain nameserver information from some source and push it to resolvconf.

Command line

The administrator can run resolvconf from the command line to add or delete nameserver information, but this is not normally necessary or advisable.

Please use the method described here: How do I add a DNS server via resolv.conf? (Randall Cook seems the easiest and works for servers too).

Share:
49,785

Related videos on Youtube

B Faley
Author by

B Faley

Updated on September 18, 2022

Comments

  • B Faley
    B Faley over 1 year

    The "/etc/resolv.conf" file becomes empty after each restart and I lose the DNS data set in it. It only contains the following text each time:

    # Generated by NetworkManager

    What should I do?