Skip to content

How to prevent networkmanager from overwriting /etc/resolve.conf on startup?

The archwiki already has a section explaining how to do this here. But i'm asking because its quite complex . Do I just have to edit dns.conf ? and set dns=none ?

1 points1 comments
Open on Reddit
About this post
Posted
Archived
Score
1 · 67% up
Kind
Text
ID
ong335

Author

31
posts
87
comments
3
media
View profile

1 comment

There are several ways.

  1. you could replace /etc/resolv.conf with a symlink (NetworkManager defaults to [main].rc-manager=symlink which will not touch symlinks). This seems the simplest, because your act of creating a symlink is taken as configuration and nothing else is needed.
  2. you could chattr +i the file to make it immutable.
  3. you could configure either [main].dns=none or [main].rc-manager=unmanaged in NetworkManager.conf. Best by dropping a snippet to /etc/NetworkManager/conf.d/90-my-resolvconf.conf. See man NetworkManager.conf.

(after doing 2) or 3), issue a systemctl reload NetworkManager).

Maybe just do 1).

5 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.