Linux

Fedora 12 上的 DNS 問題?wget wordpress.org 在 wget www.google.com 工作的地方失敗

  • December 26, 2010

我正在管理一個 Fedora 12 機器,但對網路細節還是很陌生。最近,我們伺服器上託管的一款 WordPress 應用程序已停止執行其自動更新或自動下載外掛的功能。

進一步調查,我嘗試了以下方法:

$ wget wordpress.org
--2010-12-17 11:26:50--  http://wordpress.org/
Resolving wordpress.org... failed: Temporary failure in name resolution.
wget: unable to resolve host address âwordpress.orgâ

然而:

$ wget www.google.com
--2010-12-17 11:27:26--  http://www.google.com/
Resolving www.google.com... 74.125.226.82, 74.125.226.84, 74.125.226.80, ...
Connecting to www.google.com|74.125.226.82|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://www.google.ca/ [following]
--2010-12-17 11:27:26--  http://www.google.ca/
Resolving www.google.ca... 173.194.32.104
Connecting to www.google.ca|173.194.32.104|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: âindex.html.4â

   [ <=>                                                                                                        ] 9,079       --.-K/s   in 0.02s

2010-12-17 11:27:26 (462 KB/s) - âindex.html.4â

有趣的是:

$ ping wordpress.org
PING wordpress.org (72.233.56.138) 56(84) bytes of data.
64 bytes from wordpress.org (72.233.56.138): icmp_seq=1 ttl=50 time=81.5 ms
64 bytes from wordpress.org (72.233.56.138): icmp_seq=2 ttl=50 time=67.3 ms
^C
--- wordpress.org ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1783ms
rtt min/avg/max/mdev = 67.361/74.448/81.536/7.092 ms

$ nslookup wordpress.org
Server:         192.168.2.1
Address:        192.168.2.1#53

Non-authoritative answer:
Name:   wordpress.org
Address: 72.233.56.138
Name:   wordpress.org
Address: 72.233.56.139

nscd 已停止並刷新。iptables 看起來很乾淨。在這一點上,我已經用盡我有限的能力來診斷這個問題。任何人都可以建議解決路徑嗎?

開始測試: wget wordpress.org.

最後的這個點很重要如果它不能解決問題,請執行以下操作:

  1. cat ${HOME}/.wgetrc
  2. env | grep -i proxy
  3. wget --dns-timeout 1000 wordpress.org
  4. wget --dns-timeout 1000 wordpress.org.
  5. 解釋 192.168.2.1 DNS 伺服器的用途是什麼?
  6. 顯示與記憶體、轉發(如果有)相關的 named.conf 部分。
  7. 您那裡有關於 wordpress.org 的任何聲明嗎?執行以下測試:

dig a wordpress.org. @ns1.mobiusltd.com.

dig a wordpress.org. @192.168.2.1

dig a wordpress.org @192.168.2.1

dig a wordpress.org @192.168.2.1

如果這不會給你答案顯示/etc/resolv.conf。

確保在 DNS 伺服器上正確設置了 named.conf 和 rndc 中的日誌記錄部分。然後根據需要觀察日誌、引發跟踪、dumpdb 記憶體。tcpdump 和 snoop 是你的朋友。祝你好運。

引用自:https://serverfault.com/questions/213733