2009年11月19日

[ cmd ] windows 常用網路指令 查詢DNS相關資訊

http://support.microsoft.com/kb/200525/zh-tw
Nslookup.exe 是用來測試和疑難排解 DNS 伺服器的命令列管理工具

在命令提示字元輸入 help 或 ? 將產生可用命令的清單。 在命令提示字元輸入的任何內容如果無法辨識為有效的命令,則會假設成是主機名稱,並會使用預設伺服器嘗試加以解析。如果要中斷互動式命令,請按 CTRL+C。如果要結束互動模式並返回命令提示,請在命令提示字元輸入 exit。

下列是說明輸出,並且包含完整的選項清單:

命令:  (識別碼以大寫顯示,[] 表示是選擇性的)

 NAME            - 列印關於主機/網域 NAME 的資訊,使用預設
伺服器
 NAME1 NAME2     - 同上,不同的是使用 NAME2 做為伺服器
 help 或 ?       - 列印一般命令的資訊
 set OPTION      - 設定選項

    all                 - 列印選項、目前的伺服器和主機
    [no]debug           - 列印除錯資訊
    [no]d2              - 列印詳細的除錯資訊
    [no]defname         - 將網域名稱附加到每個查詢
    [no]recurse         - 要求遞迴的查詢解答
    [no]search          - 使用網域搜尋清單
    [no]vc              - 始終使用虛擬電路
    domain=NAME         - 將預設網域名稱設為 NAME
    srchlist=N1[/N2/.../N6] - 將網域設為 N1,將搜尋清單設為 N1、N2
等等
    root=NAME           - 將根伺服器設為 NAME
    retry=X             - 將重試次數設為 X
    timeout=X           - 將初始的逾時間隔設為 X 秒
    type=X              - 設定查詢類型 (例如,A、ANY、CNAME、MX、
                          NS、PTR、SOA、SRV)
    querytype=X         - 與類型相同
    class=X             - 設定查詢類別 (例如 IN (網際網路)、ANY)
    [no]msxfr           - 使用 MS 快速區域轉送
    ixfrver=X           - 目前使用於 IXFR 轉送要求的版本

 server NAME     - 將預設伺服器設為 NAME,使用目前預設的伺服器
 lserver NAME    - 將預設伺服器設為 NAME,使用初始的伺服器
 finger [USER]   - 在目前的預設主機追蹤選擇性的 NAME
 root            - 將目前的預設伺服器設為根伺服器
 ls [opt] DOMAIN [> FILE] - 列出網域中的位址 (選擇性:輸出至
檔案)

    -a          -  列出正式名稱與別名
    -d          -  列出所有記錄
    -t TYPE     -  列出指定類型的記錄 (例如,A、CNAME、
                   MX、NS、PTR 等等)

 view FILE       - 排序 'ls' 輸出檔案並使用 pg 檢視
 exit            - 結束程式



檢查Domain Name System nslookup
Default Server:  dns.hinet.net
Address:  168.95.1.1

> www.hp.com
Server:  dns.hinet.net
Address:  168.95.1.1

Non-authoritative answer:
Name:    www.hpgtm.nsatc.net
Addresses:  15.217.120.22, 15.240.238.52
Aliases:  www.hp.com


詳細資料> set type=all
> www.hp.com
Server:  dns.hinet.net
Address:  168.95.1.1

Non-authoritative answer:
www.hp.com      canonical name = www.hpgtm.nsatc.net

hp.com  nameserver = ns2.hp.com
hp.com  nameserver = ns3.hp.com
hp.com  nameserver = ns5.hp.com
hp.com  nameserver = ns1.hp.com
hp.com  nameserver = ns6.hp.com
hp.com  nameserver = ns4.hp.com
ns1.hp.com      internet address = 15.219.145.12
ns2.hp.com      internet address = 15.219.160.12
ns3.hp.com      internet address = 15.203.209.12
ns4.hp.com      internet address = 15.203.224.14
ns5.hp.com      internet address = 15.195.192.37
ns6.hp.com      internet address = 15.195.208.12


Mail Exchanger record MX紀錄> set type=mx
> www.hp.com
Server:  dns.hinet.net
Address:  168.95.1.1

Non-authoritative answer:
www.hp.com      canonical name = www.hpgtm.nsatc.net

nsatc.net
        primary name server = admin.nsatc.net
        responsible mail addr = dl-cdn_infrastructure.level3.com
        serial  = 1286909431
        refresh = 10800 (3 hours)
        retry   = 2700 (45 mins)
        expire  = 3600000 (41 days 16 hours)
        default TTL = 900 (15 mins)
> hp.com
Server:  dns.hinet.net
Address:  168.95.1.1

Non-authoritative answer:
hp.com  MX preference = 10, mail exchanger = smtp.hp.com

hp.com  nameserver = ns1.hp.com
hp.com  nameserver = ns3.hp.com
hp.com  nameserver = ns2.hp.com
hp.com  nameserver = ns5.hp.com
hp.com  nameserver = ns4.hp.com
hp.com  nameserver = ns6.hp.com
ns1.hp.com      internet address = 15.219.145.12
ns2.hp.com      internet address = 15.219.160.12
ns3.hp.com      internet address = 15.203.209.12
ns4.hp.com      internet address = 15.203.224.14
ns5.hp.com      internet address = 15.195.192.37
ns6.hp.com      internet address = 15.195.208.12


換另一個IP試> server 168.95.192.1
Default Server:  hntp1.hinet.net
Address:  168.95.192.1

> www.hp.com
Server:  hntp1.hinet.net
Address:  168.95.192.1

Non-authoritative answer:
www.hp.com      canonical name = www.hpgtm.nsatc.net

nsatc.net
        primary name server = admin.nsatc.net
        responsible mail addr = dl-cdn_infrastructure.level3.com
        serial  = 1286909431
        refresh = 10800 (3 hours)
        retry   = 2700 (45 mins)
        expire  = 3600000 (41 days 16 hours)
        default TTL = 900 (15 mins)
> hp.com
Server:  hntp1.hinet.net
Address:  168.95.192.1

Non-authoritative answer:
hp.com  MX preference = 10, mail exchanger = smtp.hp.com

hp.com  nameserver = ns1.hp.com
hp.com  nameserver = ns6.hp.com
hp.com  nameserver = ns3.hp.com
hp.com  nameserver = ns2.hp.com
hp.com  nameserver = ns5.hp.com
hp.com  nameserver = ns4.hp.com
ns1.hp.com      internet address = 15.219.145.12
ns2.hp.com      internet address = 15.219.160.12
ns3.hp.com      internet address = 15.203.209.12
ns4.hp.com      internet address = 15.203.224.14
ns5.hp.com      internet address = 15.195.192.37
ns6.hp.com      internet address = 15.195.208.12

再換成HP內部IP試> server 15.219.160.12
Default Server:  grenoble.europe.hp.net
Address:  15.219.160.12

> hp.com
Server:  grenoble.europe.hp.net
Address:  15.219.160.12

hp.com  MX preference = 10, mail exchanger = smtp.hp.com
hp.com  nameserver = ns6.hp.com
hp.com  nameserver = ns1.hp.com
hp.com  nameserver = ns2.hp.com
hp.com  nameserver = ns3.hp.com
hp.com  nameserver = ns4.hp.com
hp.com  nameserver = ns5.hp.com
ns1.hp.com      internet address = 15.219.145.12
ns2.hp.com      internet address = 15.219.160.12
ns3.hp.com      internet address = 15.203.209.12
ns4.hp.com      internet address = 15.203.224.14
ns5.hp.com      internet address = 15.195.192.37
ns6.hp.com      internet address = 15.195.208.12


Google
>nslookup
Default Server: dns.hinet.net
Address: 168.95.1.1

> google.com
Server: dns.hinet.net
Address: 168.95.1.1

Non-authoritative answer:
Name: google.com
Addresses: 72.14.203.99, 72.14.203.103, 72.14.203.104, 72.14.203.105
72.14.203.106, 72.14.203.147

> set type=all
> google.com
Server: dns.hinet.net
Address: 168.95.1.1

Non-authoritative answer:
google.com internet address = 74.125.153.103
google.com internet address = 74.125.153.104
google.com internet address = 74.125.153.105
google.com internet address = 74.125.153.106
google.com internet address = 74.125.153.147
google.com internet address = 74.125.153.99
google.com nameserver = ns3.google.com
google.com nameserver = ns4.google.com
google.com nameserver = ns2.google.com
google.com nameserver = ns1.google.com

google.com nameserver = ns4.google.com
google.com nameserver = ns2.google.com
google.com nameserver = ns1.google.com
google.com nameserver = ns3.google.com
ns1.google.com internet address = 216.239.32.10
ns2.google.com internet address = 216.239.34.10
ns3.google.com internet address = 216.239.36.10
ns4.google.com internet address = 216.239.38.10
> set type=mx
> google.com
Server: dns.hinet.net
Address: 168.95.1.1

Non-authoritative answer:
google.com MX preference = 200, mail exchanger = google.com.s9a2.psmtp.com
google.com MX preference = 300, mail exchanger = google.com.s9b1.psmtp.com
google.com MX preference = 400, mail exchanger = google.com.s9b2.psmtp.com
google.com MX preference = 100, mail exchanger = google.com.s9a1.psmtp.com

google.com nameserver = ns4.google.com
google.com nameserver = ns2.google.com
google.com nameserver = ns3.google.com
google.com nameserver = ns1.google.com
google.com.s9a1.psmtp.com internet address = 74.125.148.10
google.com.s9a2.psmtp.com internet address = 74.125.148.11
google.com.s9b1.psmtp.com internet address = 74.125.148.13
google.com.s9b2.psmtp.com internet address = 74.125.148.14
ns1.google.com internet address = 216.239.32.10
ns2.google.com internet address = 216.239.34.10
ns3.google.com internet address = 216.239.36.10
ns4.google.com internet address = 216.239.38.10
> server 168.95.192.1
Default Server: hntp1.hinet.net
Address: 168.95.192.1

> set type=mx
> google.com
Server: hntp1.hinet.net
Address: 168.95.192.1

Non-authoritative answer:
google.com MX preference = 400, mail exchanger = google.com.s9b2.psmtp.com
google.com MX preference = 100, mail exchanger = google.com.s9a1.psmtp.com
google.com MX preference = 200, mail exchanger = google.com.s9a2.psmtp.com
google.com MX preference = 300, mail exchanger = google.com.s9b1.psmtp.com

google.com nameserver = ns3.google.com
google.com nameserver = ns4.google.com
google.com nameserver = ns1.google.com
google.com nameserver = ns2.google.com
google.com.s9a1.psmtp.com internet address = 74.125.148.10
google.com.s9a2.psmtp.com internet address = 74.125.148.11
google.com.s9b1.psmtp.com internet address = 74.125.148.13
google.com.s9b2.psmtp.com internet address = 74.125.148.14
ns1.google.com internet address = 216.239.32.10
ns3.google.com internet address = 216.239.36.10
ns4.google.com internet address = 216.239.38.10


本機
C:\WINDOWS\system32\drivers\etc\host
Refreshes all DHCP leases and re-registers DNS namesipconfig/registerdns
Display the contents of the DNS Resolver Cacheipconfig/displaydns
Purges the DNS Resolver cacheipconfig/flushdns

沒有留言:

張貼留言