一、配置解析方式
方法一:写入本地host文件
vim /etc/hosts
x.x.x.x www.baidu.com
方法二:配置DNS服务器
vim /etc/resolv.conf
然后添加如下字段
nameserver 114.114.114.114
二、配置优先级
需要配置如下文件的hosts行
vim /etc/nsswitch.com
hosts: files dns
一、配置解析方式
方法一:写入本地host文件
vim /etc/hosts
x.x.x.x www.baidu.com
方法二:配置DNS服务器
vim /etc/resolv.conf
然后添加如下字段
nameserver 114.114.114.114
二、配置优先级
需要配置如下文件的hosts行
vim /etc/nsswitch.com
hosts: files dns