0
0

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 3 years have passed since last update.

/etc/resolve.conf の書き換え防止

Last updated at Posted at 2021-10-27

AWSのEC2でサーバを再起動させると、/etc/resolve.confが書き換わります。
その対処法として、これまで再起動のたびに書き換えるという作業をしていました。。。
これはNetworkManagerに原因があるようです。
以下の方法をとることでこの書き換わりが防止できます。

〇NetworkManagerのインストール

yum install NetworkManager

〇NetworkManager.confの書き換え

cd /etc/NetworkManager
cp NetworkManager.conf NetworkManager.conf.org
vi NetworkManager.conf

下記、追記

------------------------------------------
[main]
#plugins=ifcfg-rh,ibft
dns=none

------------------------------------------

〇NetworkManagerのリロード

systemctl start NetworkManager
systemctl reload NetworkManager

これで設定ファイルの内容が反映される。
あとは/etc/resolve.confを書き換えて
systemctl reload NetworkManager
したときに、nameserverの場所が変わっていなければ成功です。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?