码迷,mamicode.com
首页 > 其他好文 > 详细

ping不通localhost但是可以ping通ip地址

时间:2020-04-07 13:05:01      阅读:127      评论:0      收藏:0      [点我收藏+]

标签:cli   sts   hello   ping   pip   txt   oca   ack   localhost   

进到目录:/ect/

找到hosts文件,为:hosts.txt,去掉后缀txt,就可以ping通了

(base) localhost:~ ligaijiang$ ping localhost
ping: cannot resolve localhost: Unknown host
(base) localhost:~ ligaijiang$ ncat 172.31.50.245 9999
Hello I am William‘s server~
Hello I am William‘s client~
bye~


Ncat: Broken pipe.
(base) localhost:~ ligaijiang$ 
(base) localhost:~ ligaijiang$ ping localhost
PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.063 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.074 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.065 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.204 ms
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.073 ms
^C
--- localhost ping statistics ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.063/0.096/0.204/0.054 ms
(base) localhost:~ ligaijiang$ 

 

ping不通localhost但是可以ping通ip地址

标签:cli   sts   hello   ping   pip   txt   oca   ack   localhost   

原文地址:https://www.cnblogs.com/jpr-ok/p/12652453.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!