To change the DNS IP address in Red Hat Enterprise Linux (RHEL), you can use the nmcli
command-line tool. nmcli
is a utility for controlling network settings on RHEL systems.
To change the DNS IP address, follow these steps:
Open a terminal window.
Use the nmcli
command to display the current DNS settings:
nmcli dev show | grep DNS
This will display the current DNS IP addresses configured on your system.
nmcli
command to modify the DNS settings. To do this, use the following command, replacing dns_ip_address
with the desired DNS IP address:sudo nmcli con mod eth0 ipv4.dns "dns_ip_address"
This will change the DNS IP address for the eth0
interface. If you want to change the DNS IP address for a different interface, replace eth0
with the name of the interface.
sudo systemctl restart network
After the network has been restarted, the DNS IP address will be changed to the new value.