Linux does not surf the web prompting Ping:unknown host check steps
The Linux system is different from the Windows platform, in order to better do network service applications. Linux is used for Web servers, and the interface is a character interface. For the novice encountered the most common problem is that Linux can not be on the Internet DNS parsing, prompting Ping:unknown host, this example with CentOS as an example
Check the NIC configuration
The problem with Ping:unknown host is that the DNS of Linux settings cannot be resolved
Encounter this problem we first check the network card settings, enter ifconfig-a can view the current network card configuration IP address
Check network card gateway settings
For the IP address set by the NIC, first verify that the IP is the correct network address. In addition to set the gateway, if you set a ping the gateway to see if it can connect properly
There is no network adapter set up for the gateway outside of the network adapter settings gateway. Also need to check the system default gateway, find the/etc/sysconfig/network configuration file (if there is no need to add a default gateway up)
Test network connectivity:
After setting up the gateway, you can test ping a public address to see if you can connect properly, and then proceed to the next step.
In addition to ensuring that the gateway is normally connected. Check that the server DNS settings are correct
Locate the configuration file for DNS settings/etc/resolv.conf file (in addition to the network card if you set up DNS will also use the DNS address inside the network card)
Check System DNS Settings
The server needs to be able to surf the internet, in addition to ensuring that the gateway is properly connected. Check that the server DNS settings are correct, locate the DNS settings profile/etc/resolv.conf file (in addition to the network card if you set up DNS will also use the DNS address inside the network card)
Special warning Note
Set the DNS server address, you must first test whether the normal connectivity. In addition, you must ensure that you have a normal DNS address that can be used
Test Domain name Resolution Ping
In accordance with the above method testing is not a problem, Nithya recommended to restart the Network service, enter the command service network restart
Enter Ping www.baidu.com to see if the normal parsing, such as the display indicates that the DNS settings are not a problem, the normal internet prompts
According to the above operation, Nithya encountered a problem.
Some of the system's resolv.conf file configurations show DNS1 and DNS2 if the settings are unsuccessful
It is recommended to change the dns1 to nameserver according to the settings.
Host Table File
Set up DNS servers for domain name resolution and Internet access, but for some special needs we need to have an address resolved to a specific address, which can be achieved by editing the /etc/hosts file. Type is the same as the host header under Windows
Linux can not be online ping:unknown host problem how to solve?