未修改
☁ ~ ping -c 5
google.comPING
google.com (216.58.200.46) 56(84) bytes of data.
---
google.com ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4059ms
修改后
☁ ~ ping -c 5
www.google.comPING
www.google.com (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.039 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.044 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.045 ms
64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.027 ms
64 bytes from localhost (127.0.0.1): icmp_seq=5 ttl=64 time=0.045 ms
查看
☁ ~ getent hosts
127.0.0.1 localhost
127.0.1.1 Solarck
127.0.0.1 localhost ip6-localhost ip6-loopback
127.0.0.1
www.google.com另外还是 ss 好用,别修改 hosts 了