Warning:
[root@localhost~]# ping www.google.com
ping: unknown host www.google.com
First see if you can ping through the router, and the router can connect to the external network
[root@localhost ~]# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=128 time=123 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=128 time=175 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=128 time=196 ms
^C
— 8.8.8.8 ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 123.681/165.315/196.354/30.601 ms
If there is no problem with network security and you can ping through
Make sure the DNS servers are set up, if not, it is recommended to set up DNS service,
[root@localhost ~]# cat /etc/resolv.conf
search localdomain
Because my DNS is not set up, I can’t ping the external network.
[root@localhost ~]#vi /etc/resolv.conf
nameserver (My IPs)
Or join (gateway)
Ensure that the gateway is set up :
[root@localhost ~]# grep GATEWAY /etc/sysconfig/network-scripts/ifcfg*
/etc/sysconfig/network-scripts/ifcfg-eno16777736:GATEWAY=192.168.100.2
If it is not set, you can add the gateway as follows:
# route add default gw 192.168.100.2
Determine the available dns resolution
# grep hosts /etc/nsswitch.conf
[root@localhost ~]# grep hosts /etc/nsswitch.conf
#hosts: db files nisplus nis dns
hosts: files dns
Fixed this issue and the ping www.google.com
[root@localhost ~]# ping www.google.com
PING www.a.shifen.com (183.232.231.173) 56(84) bytes of data.
64 bytes from 183.232.231.173: icmp_seq=1 ttl=128 time=31.9 ms
64 bytes from 183.232.231.173: icmp_seq=2 ttl=128 time=26.0 ms
64 bytes from 183.232.231.173: icmp_seq=3 ttl=128 time=26.0 ms
64 bytes from 183.232.231.173: icmp_seq=4 ttl=128 time=25.4 ms
64 bytes from 183.232.231.173: icmp_seq=5 ttl=128 time=25.6 ms
64 bytes from 183.232.231.173: icmp_seq=6 ttl=128 time=37.5 ms
64 bytes from 183.232.231.173: icmp_seq=7 ttl=128 time=27.3 ms
Similar Posts:
- Solve the problem of from 192.168.1.10: ICMP when the virtual machine can ping the gateway_ The problem of SEQ = 1 redirect network (New NextHop: 192.168.1.1)
- Under Linux, Ping: SendTo: network is unreachable appears
- CentOS ping www.google.com Error: name or service not know
- “ping: unknown host www.baidu.com “Problem solving
- [Solved] Yum command error: could not retrieve mirrorlist http://mirrorlist.centos.org…
- Job for network.service failed because the control process exited with error code [How to Solve]
- Running ntpdate reports an error: temporary failure in name resolution
- CentOS7 Failed to start LSB: Bring up/down [How to Solve]
- Solve the IP assignment prompt error, some other host already use address