iT邦幫忙

0

電腦內的hosts檔改了沒效果是哪裡問題?

557557 2010-01-07 12:19:5634975 瀏覽

請問一下 我改了電腦內的hosts檔

設置都正確 但是 都無反應

開啟設定的網址 也不會跳到指定頁面 這是哪裡問題呀?

有解決的辦法嗎?

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中
16
togoho
iT邦新手 3 級 ‧ 2010-01-07 13:32:38
最佳解答

我的原始內容只有如下

Copyright (c) 1993-1999 Microsoft Corp.

This is a sample HOSTS file used by Microsoft TCP/IP for Windows.

This file contains the mappings of IP addresses to host names. Each

entry should be kept on an individual line. The IP address should

be placed in the first column followed by the corresponding host name.

The IP address and the host name should be separated by at least one

space.

Additionally, comments (such as these) may be inserted on individual

lines or following the machine name denoted by a '#' symbol.

For example:

102.54.94.97 rhino.acme.com # source server

38.25.63.10 x.acme.com # x client host

127.0.0.1 localhost

557557 iT邦新手 4 級 ‧ 2010-01-07 15:39:25 檢舉

大大 您做頁系統是 VISTA的嗎?
怎麼那麼多英文 呵~
我的只有這一點點
但我先覆蓋你的上去看看好了~

aygw iT邦新手 3 級 ‧ 2010-01-08 16:06:49 檢舉

the way a name gets resolved is in following order:

  1. NetBIOS name cache
  2. WINS server
  3. B-node broadcast
  4. LMHOSTS file
  5. HOSTS file
  6. DNS server
    Assuming nothing unusual on 1-4, a name (網址)is resolved by using HOSTS file before it gets out to query DNS.
    In author's hosts file, it is mapping www.yahoo.com to 210.59.230.60 ( which is PChome Online 網路家庭).
    So hosts file should work accordingly---->點雅虎會跳到PCHOME.
    However, if cache exists (from previous mapping) hosts file may not work till the cache expired or flushed. Just reboot your PC or after closing your browser and wait for a while, it should work.
16
cafebug
iT邦高手 1 級 ‧ 2010-01-07 14:19:07
  1. 新增一行 210.59.230.60 www.yahoo.com 到 hosts 檔案最後面--> 存檔
  2. 加完馬上就會生效...
  3. 不想用再把hosts裡那行給拿掉再存檔
557557 iT邦新手 4 級 ‧ 2010-01-07 15:38:02 檢舉

是呀 我是這樣加來測試一下
但就是沒效果..不會跳轉

cafebug iT邦高手 1 級 ‧ 2010-01-08 11:21:45 檢舉

清一下dns cache: ipconfig/flushdns 再試試看...

10
James
iT邦大師 6 級 ‧ 2010-01-07 14:57:52

如果瀏覽器有設proxy的話,host檔就沒有用

557557 iT邦新手 4 級 ‧ 2010-01-07 15:38:33 檢舉

我沒設 不過有設VPN 但我測試的情況下 我沒開啟耶
這樣會有影響嗎?

16
adison
iT邦新手 3 級 ‧ 2010-01-07 15:45:00

557557提到:
210.59.230.60 www.yahoo.com

為何會沒用我不知道,基本上HOSTS檔案該了就會有效果的
不過,您設定的資料中,210.59.230.60應該是www.pchome.com.tw的IP位址而不是yahoo的

Ping www.pchome.com.tw [210.59.230.60] (使用 32 位元組的資料):

你要不要換一個確定正確的網址試試看?

557557 iT邦新手 4 級 ‧ 2010-01-08 16:16:06 檢舉

cafebug提到:
ipconfig

那不是雅虎IP 是PCHOME的
是我用來測試 看看設定好後 會不會點開雅虎 就會跳到PCHOME這樣
但結果發現 是設定無效的..

10
aqr199
iT邦新手 2 級 ‧ 2010-01-08 08:18:55

使用 ping www.yahoo.com 看看ip是不是你設定的位置

我想應該不是, 發生的原因可能是dns快取, www.yahoo.com對應了一堆ip位置
多試幾次才能試到你要的結果吧

10
faithdata
iT邦新手 4 級 ‧ 2010-01-08 08:45:46

請取消網路設定中的DNS設定
如168.95.1.1

理論上 host file會第一個找到 在來就是cache

209.131.36.158 www.yahoo.com.tw

10
jay0123
iT邦高手 1 級 ‧ 2010-01-08 09:16:03

請到 網際網路選項 在一般內
瀏覽歷程記錄 那全刪吧
我想你的問題就解決囉

10
Brandon
iT邦新手 4 級 ‧ 2010-01-08 09:25:08

我的經驗是,要到 網路連線的「內容->網路功能->tcp/ip->內容->進階->wins->匯入 lmhosts」,選你的 hosts 這個檔,就可以了。印象中,好像vista之後要這樣玩才行。試試看吧。

557557 iT邦新手 4 級 ‧ 2010-01-10 08:45:36 檢舉

老大 你這太複雜了 我沒那種去玩那個 呵~

10
marshuang
iT邦新手 1 級 ‧ 2010-01-08 13:31:01

你要不要試試用這種方式搭配hosts, 以先達到目的為主, 再慢慢抓為何不work的原因.

我要發表回答

立即登入回答