Cent't edit resolv.conf with root

Issues related to configuring your network
Post Reply
ProdigyLv
Posts: 8
Joined: 2017/09/19 12:42:31

Cent't edit resolv.conf with root

Post by ProdigyLv » 2019/09/27 10:32:06

Hi! sorry my eng!!!

I cen't eddit resolv.conf with root. When i add nameserver ips in to resolv.conf and try to save, i get error "Permission denied".
I cen eddit other conf. files in /etc/. I have problem only with resolv.conf file.

User avatar
jlehtone
Posts: 4530
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Cent't edit resolv.conf with root

Post by jlehtone » 2019/09/27 12:05:19

What are the current permissions of the file?

Code: Select all

ls -l /etc/resolv.conf

Does the file start with a comment: "# Generated by NetworkManager"
If yes, that is a hint that you should not edit the file directly.

If you do use NetworkManager, then you should tell NetworkManager to add those servers.
If you do use network.service, then you should tell dhclient or interface config to add those servers.


However, the default resolution library is not very smart with many servers.
It might be more efficient to run a caching nameserver. It will have its own configuration.

ProdigyLv
Posts: 8
Joined: 2017/09/19 12:42:31

Re: Cent't edit resolv.conf with root

Post by ProdigyLv » 2019/09/27 13:08:05

; generated by /usr/sbin/dhclient-script

-rw-r--r-- 1 root root 81 Oct 17 2017 /etc/resolv.conf

Post Reply