# vim /etc/hosts
127.0.0.1 www.test.com //添加这一句
//查看是否配置成功
# ping www.test.com
PING www.test.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.035 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.073 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.074 ms
64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.076 ms
64 bytes from localhost (127.0.0.1): icmp_seq=5 ttl=64 time=0.065 ms
64 bytes from localhost (127.0.0.1): icmp_seq=6 ttl=64 time=0.073 ms
64 bytes from localhost (127.0.0.1): icmp_seq=7 ttl=64 time=0.080 ms
64 bytes from localhost (127.0.0.1): icmp_seq=8 ttl=64 time=0.118 ms
64 bytes from localhost (127.0.0.1): icmp_seq=9 ttl=64 time=0.078 ms
64 bytes from localhost (127.0.0.1): icmp_seq=10 ttl=64 time=0.073 ms
...