LoginSignup
2
2

More than 5 years have passed since last update.

CentOS7 nmcliでresolvだけstaticに設定する。(内部DNSとか使いたいなど)

Posted at

基本的にDHCPでIPは設定するんだけど、resolvだけはstaticに設定したいときなど。
ipv4.ignore-auto-dns, ipv4.dnsを設定すればOKです。

# nmcli con show
名前        UUID                                  タイプ          デバイス    
有線接続 1  4dd66ee4-65a8-4895-9ede-b4aa790fb7cf  802-3-ethernet  eno16777984 

# nmcli con mod 4dd66ee4-65a8-4895-9ede-b4aa790fb7cf +ipv4.ignore-auto-dns yes
# nmcli con mod 4dd66ee4-65a8-4895-9ede-b4aa790fb7cf +ipv4.dns 8.8.8.8
# nmcli con up 4dd66ee4-65a8-4895-9ede-b4aa790fb7cf

これで、基本はDHCPでresolvだけはstaticに設定できます。

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