11
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[RHEL7]/etc/resolv.conf 強制上書き無効

Posted at

この記事を書くことになった経緯

RHEL7 で /etc/resolv.conf を書き換えたが再起動すると毎回
強制的に書き換わってしまったので備忘録を兼ねて投稿。

/etc/resolv.conf が書き換えられないようにする手順

1. /etc/NetworkManager/NetworkManager.conf に設定を追記する。

  • 追記する行: dns=none

  • 必ず[main] のところに追記してね

$ cat /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifcfg-rh
dns=none <= ここ

2. 設定を反映するために NetworkManager のサービスを再起動する。

$ sudo systemctl restart NetworkManager

3. /etc/resolv.conf にリゾルバを追記する

  • 以下は例です
$ cat /etc/resolv.conf
search hogehoge.com
nameserver 192.168.0.8
nameserver 192.168.0.9

再起動しても /etc/resolv.conf が書き換えられていなければ成功です。

11
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?