How to change DNS ip address in RHEL (Red Hat Enterprise Linux)

https‮www//:‬.lautturi.com
How to change DNS ip address in RHEL (Red Hat Enterprise Linux)

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:

  1. Open a terminal window.

  2. 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.

  1. Use the 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.

  1. Restart the network to apply the changes. You can do this using the following command:
sudo systemctl restart network

After the network has been restarted, the DNS IP address will be changed to the new value.

Created Time:2017-10-16 14:38:44  Author:lautturi