
在 Windows 2003 伺服器上我可以nslookup www.google.com
返回
Server: localhost
Address: 127.0.0.1
Non-authoritative answer:
Name: www.l.google.com
Addresses: 74.125.79.104, 74.125.79.147, 74.125.79.99
Aliases: www.google.com
然後我可以ping 74.125.79.104
:
Pinging 74.125.79.104 with 32 bytes of data:
Reply from 74.125.79.104: bytes=32 time=16ms TTL=54
Reply from 74.125.79.104: bytes=32 time=32ms TTL=54
Reply from 74.125.79.104: bytes=32 time=15ms TTL=54
Reply from 74.125.79.104: bytes=32 time=15ms TTL=54
Ping statistics for 74.125.79.104:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 15ms, Maximum = 32ms, Average = 19ms
但我不能ping www.google.com
:
Ping request could not find host www.google.com.
Please check the name and try again.
(這個問題與其他問題不同,因為這個問題有一個 TLD,它不是本地域。)
更新:我正在本地主機(127.0.0.1)運行 DNS 伺服器。即使我將其更改為使用例如 opendns,它仍然可以 nslookup 主機名稱和 ping ip 位址,但不能 ping 主機名稱。那麼有什麼問題嗎?
**更新2:**
這是 ipconfig /all 結果:
Windows IP Configuration
Host Name . . . . . . . . . . . . : SERVER
Primary Dns Suffix . . . . . . . : NETWORK.local
Node Type . . . . . . . . . . . . : Unknown
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : NETWORK.local
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Broadcom NetXtreme Gigabit Ethernet #2
Physical Address. . . . . . . . . : 00-0F-1F-56-3B-AA
DHCP Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 192.168.7.2
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.7.1
DNS Servers . . . . . . . . . . . : 127.0.0.1
更新3:
感謝大家的幫忙和建議。我很感激。
Ipconfig /flushdns 傳回:成功刷新 DNS 解析器快取
Ipconfig /displaydns 回傳:
2.7.168.192.in-addr.arpa
----------------------------------------
Record Name . . . . . : 2.7.168.192.in-addr.arpa.
Record Type . . . . . : 12
Time To Live . . . . : 0
Data Length . . . . . : 4
Section . . . . . . . : Answer
PTR Record . . . . . : webserver.mydomainname.com
1.0.0.127.in-addr.arpa
----------------------------------------
Record Name . . . . . : 1.0.0.127.in-addr.arpa.
Record Type . . . . . : 12
Time To Live . . . . : 0
Data Length . . . . . : 4
Section . . . . . . . : Answer
PTR Record . . . . . : localhost
更新4:
Wireshark 顯示如下:
3 11.540542 208.67.220.220 192.168.7.2 DNS Standard query response A 74.125.79.99 A 74.125.79.104 A 74.125.79.147
6 42.056794 192.168.7.2 192.168.7.255 NBNS Name query NB WWW.GOOGLE.COM<00>
這很奇怪:當我這樣做時ping
,它會向 192.168.7.255 發送資料包,而不是向 DNS 伺服器詢問位址
更新5:
這是 netdig 不得不說的話:
opcode: Query, status: NoError, id: 42
flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 0
QUESTION SECTION:
www.google.com. IN A
ANSWER SECTION:
www.google.com. 86324 IN CNAME www.l.google.com.
www.l.google.com. 224 IN A 74.125.79.99
www.l.google.com. 224 IN A 74.125.79.104
www.l.google.com. 224 IN A 74.125.79.147
Query time: 0 ms
Server : 192.168.7.2:53 udp (192.168.7.2)
When : 1/6/2011 12:33:50 PM
Size rcvd : 100
答案1
您正在使用自己 (127.0.0.1) 作為 DNS...您真的是這個意思嗎?如果您自己的電腦正在執行 DNS 伺服器服務,則 nslookup 將會起作用。
確保網路介面卡上的 DNS 設定正確。
答案2
只是好奇,您是否將伺服器上的 DNS 設定為 127.0.0.1,因為您在伺服器上使用 DNS 並設定了指向 ISP 的 DNS 伺服器的 DNS 轉送器?
如果是這種情況,您可以嘗試這樣的測試。將伺服器適配器上的 DNS 設定為直接指向 ISP 的 DNS 伺服器。此時,您可以執行 ipconfig /flushdns 和/或重新啟動並重試。您可能會透過這種方式獲得更多資訊...