sudo vim /etc/resolv.conf
配置文件在 /etc/resolv.conf 中
用 sudo 权限修改此文件配置
文件的大致内容如下
### /etc/resolv.conf file autogenerated by netconfig!## Before you change this file manually, consider to define the# static DNS configuration using the following variables in the# /etc/sysconfig/network/config file:# NETCONFIG_DNS_STATIC_SEARCHLIST# NETCONFIG_DNS_STATIC_SERVERS# NETCONFIG_DNS_FORWARDER# or disable DNS configuration updates via netconfig by setting:# NETCONFIG_DNS_POLICY=''## See also the netconfig(8) manual page and other documentation.## Note: Manual change of this file disables netconfig too, but# may get lost when this file contains comments or empty lines# only, the netconfig settings are same with settings in this# file and in case of a "netconfig update -f" call.#### Please remove (at least) this line when you modify the file!nameserver 8.8.8.8#nameserver 8.8.4.4