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 "10.124.141.51,10.112.42.10"
nmcli device reapply eth0

 

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

~]# resolvectl
Global
       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: 10.124.141.51
       DNS Servers: 10.124.141.51 10.112.42.10

 



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.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |