blog/content/post/change-nameserver-using-networkmanager.md
2022-08-01 18:10:41 +05:30

1.4 KiB

title date lastmod draft keywords description tags categories author comment toc autoCollapseToc postMetaInFooter hiddenFromHomePage contentCopyright reward mathjax mathjaxEnableSingleDollar mathjaxEnableAutoNumber hideHeaderAndFooter flowchartDiagrams sequenceDiagrams
Change Nameserver using NetworkManager 2022-08-01T17:59:33+05:30 2022-08-01T17:59:33+05:30 false
nameserver
networkmanager
nmcli
networking
linux
false false false true false false false false false false false
enable options
false
enable options
false

Do not edit /etc/resolv.conf. It will likely be replaced by NetworkManager.

Open a shell and add nameserver for existing connection.

nmcli con mod $ssid ipv4.dns "1.1.1.1 1.0.0.1"

The SSID can be found with nmcli con.

Replace the IP addresses to your desired ones.

Now restart the connection to apply the changes.

nmcli con down $ssid
nmcli con up $ssid 

Verify with cat /etc/resolv.conf.