Skip to content

Instantly share code, notes, and snippets.

@a2ikm
Last active September 25, 2017 02:16
Show Gist options
  • Select an option

  • Save a2ikm/a4538e48bc7ee0ab3e20d4505d613cad to your computer and use it in GitHub Desktop.

Select an option

Save a2ikm/a4538e48bc7ee0ab3e20d4505d613cad to your computer and use it in GitHub Desktop.
[root@localhost ~]# nmcli con
[root@localhost ~]# nmcli con show System\ eth0
[root@localhost ~]# nmcli con mod System\ eth0 +ipv4.dns "8.8.8.8 8.8.4.4"
[root@localhost ~]# nmcli con mod System\ eth0 ipv4.ignore-auto-dns yes
[root@localhost ~]# systemctl restart NetworkManager
[root@localhost ~]# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 8.8.8.8
nameserver 8.8.4.4
https://blog.apar.jp/linux/3147/
https://access.redhat.com/documentation/ja-jp/red_hat_enterprise_linux/7/html/networking_guide/sec-using_the_networkmanager_command_line_tool_nmcli
[root@localhost ~]# nmcli con mod System\ eth0 ipv6.method auto
[root@localhost ~]# nmcli con mod System\ eth0 +ipv6.dns "2001:4860:4860::8888 2001:4860:4860::8844"
[root@localhost ~]# nmcli con mod System\ eth0 ipv6.ignore-auto-dns yes
[root@localhost ~]# systemctl restart NetworkManager
[root@localhost ~]# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 2001:4860:4860::8888
# NOTE: the libc resolver may not support more than 3 nameservers.
# The nameservers listed below may not be recognized.
nameserver 2001:4860:4860::8844
https://developers.google.com/speed/public-dns/docs/using
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment