Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What should I do to make /etc/resolv.conf only editable by root? I don't want anything to edit it after I specify my own DNS servers, i.e. only editable by the user with root privileges.

share|improve this question
up vote 7 down vote accepted

It is already so.

If you mean you want NetworkManager do not overwrite resolv.conf you should consider declaring your nameservers in NetworkManager, rather than writing them in resolv.conf.

To this aim, it is enough to go to IPv4 page of the connection and set the method to "Automatic (DHCP) address only", or "Manual" if you want to set also a static IP address.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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