Run the following command to see the info inside the config file:
cat /etc/sysconfig/network-scripts/ifcfg-eth0
Here is an example of what the output may look like:
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="no"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="eth0"
UUID="082c9019-5724-4f6f-b0ef-972f8fc5cf03"
DEVICE="eth0"
ONBOOT="yes"
IPV6_PRIVACY="no"
IPADDR="192.168.0.15"
PREFIX="24"
GATEWAY="192.168.0.1"
DNS1="192.168.0.1"
DNS2="192.168.0.1"
ZONE=public
Next run this command to edit the config file:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
Change the fields you want like so:
Press i to change the mode to insert text
edit the new values
press the Esc key and type:
:w
(then press enter, this will save the file. Use :W! to force the save if needed)
Then type:
:q
(to exit)
Reference: https://www.techinformant.in/dns-server-configuration-on-rhelcentos-7/