這里簡單說明下,這個問題的兩個原因與解決方法:第一種: 需要修過注冊表最近有同仁反應hosts不起作用,在網(wǎng)上找了很久,只找到大部分都是下面這篇文章,但看了有問題的客戶機,發(fā)現(xiàn)需要修正的設定是相同的,
這里簡單說明下,這個問題的兩個原因與解決方法:第一種: 需要修過注冊表最近有同仁反應hosts不起作用,在網(wǎng)上找了很久,只找到大部分都是下面這篇文章,但看了有問題的客戶機,發(fā)現(xiàn)需要修正的設定是相同的,所以應該不是這個解決辦法! 由于的 需要,經(jīng)常要修改C:windowssystem32driversetchosts里面的域名指向。可是莫名其妙的是,自己電腦上的 hosts文件修改了沒有作用,google幾天沒有結果,郁悶。所幸的是還是找到了一篇高人的文章,原來是把 HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServic esTcpipParameters里面的"DataBasePath"類型從"REG_SZ"修改為"REG_EXPAND_SZ"就OK了(需要 重新啟動計算機),據(jù)說可能是安裝MSN 7.0/7.5后類型被修改了,而微軟對這個完全沒有說明,F(xiàn)T。 全文如下 Open regedit and browse to HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServic esTcpipParameters Examine "DataBasePath" key in this node carefully. If the path is set to %SystemRoot%System32driversetc and the key type is anything but REG_EXPAND_SZ, that is is your problem. If the type is REG_SZ, edit the DatabasePathregistry keyand hardcode th entire path (remove the env variable) e.g. c:windowssystem32driversetc or delete the existing registry key and create a new key by the same name (DataBasePath) of type REG_EXPAND_SZ and set the value to %SystemRoot%System32driversetc Files in etc dir should now be enabled. Why did this happen to you? Most likely you installed MSN Messenger 7.0/7.5 which changed the type of this key. Why did it do that, why didn't it inform you of what it has done? Ask Bill gates? Is it documented anywere? Not to the best of my knowledge. 不過在查找的時候發(fā)現(xiàn)有一個人的回復是,“保證格式和權限正確,這倒提醒了我,查看hosts文件的權限,果然這個文件沒有集成這個文件夾的權限,于是修改權限,問題解決! 總結:對于的系統(tǒng)參數(shù),一個要格式正確外,一定要注意權限的設定,這個很容易被忽略掉。但問題在于這個文件從外部拷貝進來,為什么權限沒有被文件夾自動覆蓋掉,不解!第二種:因為書寫順序不對(我就是因為這個原因)應該是先寫 ip[tab]域名的格式例如: 127.0.0.1 www.cctv.com