Skip to content

临时生效

修改 /etc/resolv.conf 文件

bash
vi /etc/resolv.conf 
# Generated by NetworkManager
nameserver 192.168.57.1
nameserver fe80::26cf:24ff:feff:6678%eth0

修改后保存即可

永久生效

修改网卡信息,默认网卡为 ifcfg-eth0

bash
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="static"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="eth0"
UUID="1821cc06-c3b5-4fc0-980a-b31218fe6b98"
DEVICE="eth0"
ONBOOT="yes"
IPADDR="192.168.57.114"
NETMASK="255.255.255.0"
GATEWAY="192.168.57.1"
#DNS1="223.5.5.5"
DNS1="192.168.57.1"