lmhost和host是静态解析名字的文件,dns和wins是动态解析名字的服务。lmhost基于nebios,netbios支持最长16和字符,不能带点(“.”);host基于hostname,最长支持255各字符,可以带点。
在95、98里面是用lmhost的,2k里面这两个文件都有。
解析过程如下:
1.host解析:local host name --->hosts file--->dns server--->netbios name cache--->wins server--->broadcast--->lmhost file
即:计算机在把名字解析为ip时,先找本地计算机名称,如果不是,找host文件,找不到,找dns server,如果找不到,找netbios缓存,找不到,找wins server解析,还找不到,发广播,还找不到,才找lmhost,还找不到........,那就找不到了,呵呵
2.netbios解析:netbios name cache-->wins server-->broadcast-->lmhost file-->host file--->dns server
----------------------------------------------------------------------------------------------------------------------------------------------
查看缓存方法:
dns缓存,可以用 ipconfig /displaydns 查看
netbios缓存,可以用nbtstat -c查看
------------------------------------------------------------------------------------------
Host失效原因:
我用ipconfig/displaydns可以看到:
www.yahoo.com----------------------------------------
Record Name . . . . . :
www.yahoo.comRecord Type . . . . . : 1
Time To Live . . . . : 596469
Data Length . . . . . : 4
Section . . . . . . . : Answer
A (Host) Record . . . : 10.0.0.110
但不知为什么不起作用?
我的机器在用微软的proxy client,这个会影响吗?
===
Disable proxy client后, hosts文件起作用了。
看来proxy client会改变解析顺序。
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。