FreeKB - Linux Commands nmcli modify
Linux Commands - nmcli modify

The nmcli connection modify command can be used to modify a network interface. Before using the nmcli modify command, you probably will want to use the nmcli connection show command to get the name and UUID of the network interface.

nmcli connection show
. . .
NAME  UUID                                  TYPE      DEVICE 
eth0  5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03  ethernet  eth0


Here is an example of how to change the DNS servers of the interface.

nmcli connection modify eth0 ipv4.dns ","
nmcli device reapply eth0


The resolvectl command can then be used to show the current DNS server being used.

~]# resolvectl
       Protocols: LLMNR=resolve -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub

Link 2 (ens192)
    Current Scopes: DNS LLMNR/IPv4
         Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server:
       DNS Servers:


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter 7576c in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |