Linux does not have Internet access prompts Ping:unknown host check steps
The Linux system differs from the Windows platform in order to better use the Web services. Linux is mostly used for Web servers, and the interface is the character interface. For novice encounter the most common problem is that Linux can not access the Internet DNS resolution, prompted Ping:unknown host, this example to CentOS as an example
First, Linux system network configuration
1, check the network card configuration
The problem of Ping:unknown host is the most important is the DNS resolution of Linux settings, encountered this problem we first check the settings of the network card, input ifconfig-a can view the current network adapter configuration IP Address
2, check the network card gateway settings
1, for the network card set IP address, first to verify that the IP is a correct network address. In addition to the installation of the gateway, if set a ping the gateway to see whether the normal connectivity
2. For network card settings gateway, there is no network card to set the gateway. You also need to check the default gateway for the system and locate the/etc/sysconfig/network configuration file as shown below (if you don't need to add a default gateway up)
4, Test network connectivity:
After you set up the gateway, you can test ping a public network address to see whether the normal connection, if you can connect, and then continue next
Second, check system DNS settings
1, in addition to ensure that the gateway can be normal connectivity. Check that the server DNS settings are correct, locate the configuration file/etc/resolv.conf file for DNS settings (in addition, if DNS is set up in the network card, it will also use the DNS address of the network card).
1, check the system DNS settings
The server needs to be able to access the Internet, except to ensure that the gateway is properly connected. Check that the server DNS settings are correct, locate the configuration file/etc/resolv.conf file for DNS settings (in addition, if DNS is set up in the network card, it will also use the DNS address of the network card).
2, Special reminder note
Set the DNS server address, you must first test whether the normal connectivity. In addition, you must ensure that the DNS address is normal to use
3, test the domain resolution PING
1, in accordance with the above method test has no problem, 嚛 proposed to restart the network services, input the following Image command service network restart
2, input ping www.baidu.com see whether the normal resolution, the following figure shows that the DNS settings are no problem can be normal internet prompts
Iii. Other issues and considerations
1, according to the above screenshot operation, 嚛 encountered a problem. Some of the system's resolv.conf file configuration shows DNS1 and DNS2 if the settings are unsuccessful, it is recommended to follow the chart set, the dns1 to NameServer
1. Host Table File
Set up DNS servers for domain name resolution and Internet access, but for certain specific requirements we need to have an address resolved to a specific address, which can be done by editing the/etc/hosts file. Type is the same as the main header under Windows
Note:
1, check the network card settings
2. Connectivity of straightened Gateway
3, set up DNS, etc. can