在Unix系统下面有一个/etc/hosts文件,在个人Mac上,这个文件的内容以下:浏览器
## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost
这个文件显示了域名和网址之间的映射状况。在这个文件里出现的网址,访问的时候不须要使用DNS协议,而是直接读取域名。oop
能够试着在文件末尾添加一行:this
192.168.1.23 www.baidu.com
这样在浏览器里输入百度网址,会发现百度首页永远出现不了了!spa