[Root@localhost ~]# Ping www.baidu.com
Prompt Ping:unknown Host
This is because the DNS server is not configured, and if the network is not a problem, you can follow these steps to check:
1) vi/etc/resolv.conf
Add to
NameServer 192.168.59.2 Native gateway address (router address)
Search Localdomain # Search parameter Specify the search order for the domain name
2) Set up the gateway
Vi/etc/sysconf/network-scripts/ifcfg-eth0
Add to
gateway=192.168.59.2
Or
Using command settings
Route add default GW 192.168.59.2
Then restart the Network service:
Service Network restart
3 ensure available DNS resolution
[Root@localhost desktop]# grep hosts/etc/nsswitch.conf
Output
Hosts:files DNS
The file/etc/nsswith.conf is an extended name server switch developed by Sun. Used to set the order in which files are read, whether to read the/etc/hosts file first or to find the DNS server first.
Hosts:files DNS Specifies to find the/etc/hosts file first, and if it fails, to the DNS server to find the host information that corresponds to the domain name.
4) Test DNS
Ping www.baidu.com
More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/Servers/DNS/