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?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
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? ;-)
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.
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).