兩天前更新到了Ubuntu14.04,結果發現firefox打不開百度了,但卻能打開其他網站,這讓我很是郁悶。于是乎我開始尋找問題。
猜想1:首先想到的是不是我的網絡有問題
實驗1:pingwww.baidu.com
[email protected]:~$ pingwww.baidu.com
PINGwww.a.shifen.com (220.181.111.188) 56(84) bytes of data.
^C
--- www.a.shifen.comping statistics ---
9 packetstransmitted, 0 received, 100% packet loss, time 8000ms
由于浏覽器能夠通路bing,于是我又pingwww.bing.com
[email protected]:~$ pingwww.bing.com
PINGcn.a-0001.a-msedge.net (202.89.233.101) 56(84) bytes of data.
^C
---cn.a-0001.a-msedge.net ping statistics ---
8 packetstransmitted, 0 received, 100% packet loss, time 7056ms
結論1:域名解析沒有問題
問題2:域名解析沒問題,但是ping不通是怎麼回事呢?。
實驗2:ping一下網關試試。
[email protected]:~$ route-n
Kernel IP routingtable
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 124.16.79.254 0.0.0.0 UG 0 0 0 eth0
124.16.76.0 0.0.0.0 255.255.252.0 U 1 0 0 eth0
[email protected]:~$ ping124.16.79.264
ping: unknown host124.16.79.264
結論2:原來ping不通是因為管理者對網關的設定問題。不用去管它了。
問題3:直接通路百度的IP行不行呢?
實驗3:我直接把百度的ip位址寫道firefox的位址欄裡,沒問題,能夠打開!但是仍然沒法打開二級頁面。
問題4:這麼奇葩的現象,是不是firefox本身的問題呢?
實驗4:啥也别說了,換浏覽器!安裝chrome
[email protected]:~$ sudoapt-get install google-chrome
顯示沒有找到安裝包,更新源試試。
[email protected]:~$ sudo sh -c'echo "deb http://dl.google.com/linux/chrome/deb/ stable main">> /etc/apt/sources.list.d/google-chrome.list'
[email protected]:~$ sudoapt-get update
安裝[email protected]:~$sudo apt-get install google-chrome-stable
OK,安裝成功。
迫不及待的代開chrome,輸入www.baidu.com,我X居然神奇般的打開了!
結論4:看來果然是firefox本身的問題。
問題5:但是firefox到底哪裡出了問題呢?
實驗5:
在網上搜“ubuntufirefox無法打開百度”,遇到這類問題的人還不少。有的說要去aoubt:config添加某個字段,我嘗試了一下,沒有效果。
是不是安裝的某個插件出了問題,于是我把所有的插件都禁用了,仍然不行。
怎麼辦呢,就在我無計可施的時候,我想到了firefox菜單欄上的Help菜單,Help->Restartwith Ads-on disabled,就是這裡了!點選之後,出來一個對話框,選項中又一個“ResetFirefox”,重置吧,這樣更徹底。點選重置之後,終于可以正常通路百度了。
結論5:最終我并沒能夠找到firefox哪裡出了毛病,但是重置浏覽器的方式确實是一個可行又非常簡單的解決方式。firefox具體哪裡出了問題,還望高人指點。
連上百度的感覺,就像在爆表的霧霾天裡苟延殘喘了一個月,終于見到了藍天一樣,終于可以自由的呼吸了。
幾個常用的網絡指令:
netstat -nap檢視應用程式的端口使用情況
/etc/init.d/networkingstart | stop | restart啟用或者關閉網絡
route -n 參看本機網關
網絡相關的配置檔案:
/etc/network/interfaces網卡配置檔案
/etc/resolv.confDSN伺服器配置檔案
/etc/hosts主機名和IP配置檔案
我電腦的軟體配置資訊:
32位Ubuntu14.04
firefox 28.0 MozillaFirefox for Ubuntu canonical - 1.0
參考文獻:
linux下檢視網關的指令:http://blog.sina.com.cn/s/blog_674d87000100pzmh.html
Ubuntu安裝Chrome步驟:http://www.douban.com/note/252982281/