6

This question already has an answer here:

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?

marked as duplicate by Rinzwind, user25656, rɑːdʒɑ, Eric Carvalho, hhlp Feb 24 '13 at 11:02

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

5

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).

Not the answer you're looking for? Browse other questions tagged or ask your own question.