- Linux Administration Cookbook
- Adam K. Dean
- 101字
- 2021-07-02 14:24:33
See also
We actually used nmcli here to make changes to configuration files. We can physically see those changes by looking at the eth0 configuration file before and after our DNS changing command.
Before looks like this:
$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="dhcp"
ONBOOT="yes"
TYPE="Ethernet"
PERSISTENT_DHCLIENT="yes"
While after is a bit more verbose:
$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=Ethernet
PERSISTENT_DHCLIENT="yes"
PROXY_METHOD=none
BROWSER_ONLY=no
DNS1=1.1.1.1
DEFROUTE=yes
PEERDNS=no
IPV4_FAILURE_FATAL=no
IPV6INIT=no
NAME="System eth0"
UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03
One thing we didn't cover is IPv6, but the principles are the same as IPv4.
Take a look at how IPv6 servers are configured, and how they end up in /etc/resolv.conf.