cht電腦資訊網路
adm Find login register

關於 DNS 查詢的問題

coolcd
joined: 2008-01-21
posted: 2596
promoted: 348
bookmarked: 95
1subject: 關於 DNS 查詢的問題Promote 0 Bookmark 02010-09-13quote  

剛在亂玩發現

$host tw.yahoo.com
tw.yahoo.com is an alias for tw-cidr.fyap.b.yahoo.com.
tw-cidr.fyap.b.yahoo.com is an alias for tw-tpc-fo.fyap.b.yahoo.com.
tw-tpc-fo.fyap.b.yahoo.com has address 203.84.202.164

$ host http://tw.yahoo.com
http://tw.yahoo.com is an alias for wildcard.g05.yahoodns.net.
wildcard.g05.yahoodns.net is an alias for yahoo-wildcard.a05.yahoodns.net.
yahoo-wildcard.a05.yahoodns.net has address 98.137.132.14

$ host www.google.com.tw
www.google.com.tw is an alias for www.google.com.
www.google.com is an alias for www.l.google.com.
www.l.google.com has address 66.102.7.99
www.l.google.com has address 66.102.7.104

$ host http://www.google.com.tw
http://www.google.com.tw has address 67.215.65.132
Host http://www.google.com.tw not found: 3(NXDOMAIN)

 不知道有加 http 與沒加 http 差別是在哪裡?為什麼會跳到不同的 domain name?

edited: 2
eliu

joined: 2007-08-09
posted: 11468
promoted: 617
bookmarked: 187
新竹, 台灣
2subject: Promote 0 Bookmark 02010-09-13quote  

沒什麼,與http:// 無關,yahoo 把不認識轉過去而已,底下用 ggyy 也是一樣的結果

 

$ host ggyy.yahoo.com
ggyy.yahoo.com is an alias for wildcard.g05.yahoodns.net.
wildcard.g05.yahoodns.net is an alias for yahoo-wildcard.a05.yahoodns.net.
yahoo-wildcard.a05.yahoodns.net has address 98.137.132.14

coolcd
joined: 2008-01-21
posted: 2596
promoted: 348
bookmarked: 95
3subject: Promote 0 Bookmark 02010-09-13quote  

謝謝,原來如此,被自己搞糊塗了。 :)

edited: 1
企鵝狂
joined: 2008-04-01
posted: 185
promoted: 20
bookmarked: 7
4subject: Promote 0 Bookmark 02010-09-13quote  
mac:~ adolf$ host http://tw.yahoo.com
http://tw.yahoo.com is an alias for wildcard.g05.yahoodns.net.
wildcard.g05.yahoodns.net is an alias for yahoo-wildcard.a05.yahoodns.net.
yahoo-wildcard.a05.yahoodns.net has address 98.137.132.14
 
他就說是wildcard了...
 
因為他是recursive搜尋 .com, .yahoo.com 然後在 .yahoo.com 裡面找  http://tw 這個host,找不到,隨便回應你。
 
加上/, http://tw.yahoo.com/ 就會在第一關就卡關了。 
coolcd
joined: 2008-01-21
posted: 2596
promoted: 348
bookmarked: 95
5subject: Promote 0 Bookmark 02010-09-14quote  

事後再來看就懂 wildcard 是什麼意思了,可是沒人提點之前,一直在想 http XD

另外,重看 google 給的訊息,覺得很奇怪,讓人很容易被誤導

http://www.google.com.tw has address 67.215.65.132
Host http://www.google.com.tw not found: 3(NXDOMAIN)

據測試,這個 ip 應該也是 wildcard

企鵝狂
joined: 2008-04-01
posted: 185
promoted: 20
bookmarked: 7
6subject: Promote 1 Bookmark 12010-09-14quote  

你用了opendns...

 

mac:~ adolf$ nslookup 67.215.65.132

Server:         127.0.0.1

Address:        127.0.0.1#53

Non-authoritative answer:

132.65.215.67.in-addr.arpa      name = hit-nxdomain.opendns.com 

 

我的dns設定, 127.0.0.1 dnsmasq cache,

dnsmasq設定,前兩個是isp的,之後google,opendns。

 

用isp的dns有時候會有些用途http://blog.ksc91u.info/2010/09/blog-post.html 

coolcd
joined: 2008-01-21
posted: 2596
promoted: 348
bookmarked: 95
7subject: Promote 0 Bookmark 02010-09-14quote  
企鵝狂

用isp的dns有時候會有些用途http://blog.ksc91u.info/2010/09/blog-post.html 

從上面的鏈結,我整理出來的結論是,像這些跨國大網站,雖然 domain name 相同,但可以做到

不同 ISP 的使用者連上網站時,DNS Server 可以把同一個域名對應到使用者 ISP 內該網站的分站,所以會比較快,是這樣子嗎?

在我這邊加上 http 的兩個例子,還是覺得有點奇怪。

opendns 向 root 查 .com → 向 .com 查 .yahoo.com → 向 .yahoo.com 查 http://tw.yahoo.com → 查不到 http://tw 這台主機,所以 yahoo.com 的 DNS Server 告訴 OpenDNS 轉到 wildcard.g05.yahoodns.net.

opendns 向 root 查 .tw → 向 .tw 查 .com.tw → 向 .com.tw 查 .google.com.tw → 向 .google.com.tw 查 http://www.google.com.tw → 查不到 http://www 這台主機,google.com.tw 告訴我 host not found 的訊息很合理,可是在上一行 OpenDNS 卻又告訴我 http://www.google.com.tw 的位址是 67.215.65.132 (OpenDNS 的 wildcard?),哪妮?

目前想法是,如果 OpenDNS 向某 DNS Server 查詢結果是 host not found,就會回你 OpenDNS Server 的 wildcard server 位址?而 yahoo 的例子,沒有像 google 一樣,是因為 yahoo.com 的DNS Server 會回傳自己的 wildcard server 的 ip,沒有回傳 host not found 給 opendns,所以結果是 yahoo 的 wildcard ip。

edited: 2

cht電腦資訊網路
adm Find login register
views:18160