以下命令會在 Mac (Linux適用) 和 Windows 下同時(shí)運(yùn)行,或許能幫你解決一些疑惑先做個(gè)簡單的介紹吧,nslookup (全稱 name server lookup) ,是一個(gè)在命令行界" />
時(shí)間:2023-02-12 17:39:01 | 來源:建站知識
時(shí)間:2023-02-12 17:39:01 來源:建站知識
分享一下自己在使用計(jì)網(wǎng): 自頂向下這本書課后習(xí)題時(shí)的一些經(jīng)驗(yàn)先做個(gè)簡單的介紹吧,nslookup (全稱 name server lookup) ,是一個(gè)在命令行界面下的網(wǎng)絡(luò)工具,它有兩種模式: 交互 & 非交互,進(jìn)入交互模式在命令行界面直接輸入
以下命令會在 Mac (Linux適用) 和 Windows 下同時(shí)運(yùn)行,或許能幫你解決一些疑惑
nslookup
按回車,非交互模式則是后面跟上查詢的域名或者 IP 地址按回車。一般來說,非交互模式適用于簡單的單次查詢,若需要多次查詢,則交互模式更加適合,例如計(jì)網(wǎng)第七版第二章的課后習(xí)題p19 (單純舉例子,沒有書不影響接下來的閱讀),從根服務(wù)器進(jìn)行迭代查詢。nslookup –option1 –option2 host-to-find dns-server
baidu.com
為例nslookup baidu.com
下圖為運(yùn)行效果,左側(cè)是 Mac 端,右側(cè)是 Windows,Linux 呈現(xiàn)效果基本與 Mac 一致。結(jié)果的介紹會放在下文的交互模式部分,之后的演示大部分會在交互模式的狀態(tài)下進(jìn)行。nslookupbaidu.com
可以看到進(jìn)入交互模式后不再需要輸入完整的命令便可以進(jìn)行查詢,并且可以連續(xù)的進(jìn)行查詢(友情提示Ctrl+C
或者Cmd+C
退出)nslookup -ty=ptr 8.8.8.8
驗(yàn)證,ptr也是一種記錄類型,可以用進(jìn)行反向DNS解析(Reverse DNS Lookup),拓展鏈接: reverse-dns-lookupIf a hostname/IP address pair is cached in a DNS server and another query arrives to the DNS server for the same hostname, the DNS server can provide the desired IP address, even if it is not authoritative for the hostname. Because hosts and mappings between hostnames and IP addresses are by no means permanent, DNS servers discard cached information after a period of time (often set to two days).
39.156.69.79:80
nslookup -ty=ptr 8.8.8.8
man nslookup | less
,使用空格往下翻頁,b往上翻頁,q退出nslookup/?
,還有一種是在交互模式下輸入help
或者?
nslookup/?
Windows 給出的命令為通用命令,Mac/Linux 可用于借鑒-querytype
-type
使用 :)-querytype
和 -type
的效用一致,可以簡寫為 -q
和 -ty
,其在不指定類型的情況下默認(rèn)查詢類型為 Anslookup -ty=類型 name
set ty=類型
If Type=NS , then Name is a domain (such as http://foo.com ) and Value is the hostname of an authoritative DNS server that knows how to obtain the IP addresses for hosts in the domain.This record is used to route DNS queries further along in the query chain. As an example, ( http://foo.com , http://dns.foo.com , NS) is a Type NS record.
nslookupset ty=NS
set all
可以查看常用選項(xiàng)的當(dāng)前值以及當(dāng)前默認(rèn)的服務(wù)器和主機(jī)信息,注意,DNS 服務(wù)器不能通過 set 指定baidu.com
為出發(fā)點(diǎn),來看看對應(yīng)的權(quán)威名字服務(wù)器dig baidu.com ns
,會對結(jié)果有個(gè)更直觀的感觸If Type=A , then Name is a hostname and Value is the IP address for the hostname. Thus, a Type A record provides the standard hostname-to-IP address mapping. As an example, ( http://relay1.bar.foo.com , 145.37.93.126, A) is a Type A record.
dns.baidu.com
對baidu.com
執(zhí)行 type=A 的查詢來看看結(jié)果與最開始有什么不同server dns.baidu.comset ty=Abaidu.com
A mail exchanger record (MX record) specifies the mail server responsible for accepting email messages on behalf of a domain name. It is a resource record in the Domain Name System (DNS). It is possible to configure several MX records, typically pointing to an array of mail servers for load balancing and redundancy.查找
host-to-find
域的郵件服務(wù)器,SMTP(Simple Mail Transfer Protocol)
(Ps:smtp并非一定是郵件服務(wù)器名字的組成部分)。ns2.baidu.com
ns7.baidu.com
dns.baidu.com
ns4.baidu.com
ns3.baidu.com
皆為 baidu.com 的權(quán)威 DNS 服務(wù)器。關(guān)鍵詞:命令,入門
客戶&案例
營銷資訊
關(guān)于我們
微信公眾號
版權(quán)所有? 億企邦 1997-2025 保留一切法律許可權(quán)利。