如何使用Linuxnslookup命令幫助和DNS查找-創(chuàng)新互聯(lián)

這期內容當中小編將會給大家?guī)碛嘘P如何使用Linux nslookup命令幫助和DNS查找,文章內容豐富且以專業(yè)的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。

宜秀網(wǎng)站建設公司創(chuàng)新互聯(lián)建站,宜秀網(wǎng)站設計制作,有大型網(wǎng)站制作公司豐富經(jīng)驗。已為宜秀上1000家提供企業(yè)網(wǎng)站建設服務。企業(yè)網(wǎng)站搭建\成都外貿網(wǎng)站建設要多少錢,請找那個售后服務好的宜秀做網(wǎng)站的公司定做!

 nslookup代表“名稱服務器查找”,是從DNS服務器獲取信息的有用命令。它對于解決與DNS相關的問題也非常有用,可以查詢到DNS(域名服務器)并獲取IP地址的任何域的DNS記錄。

DNS查找示例

使用以下命令查找域的地址記錄。它查詢域名服務器并獲取詳細信息。

# nslookup google.com
Server:         8.8.8.8
Address:        8.8.8.8#53
Non-authoritative answer:
Name:   google.com
Address: 216.58.219.206

反向DNS查找

還可以使用ip地址進行反向dns查找,可以將使用IP地址解析相應的域。需要注意的是,這是在域的反向區(qū)域中配置的不同記錄。

# nslookup 216.58.219.206
Server:         8.8.8.8
Address:        8.8.8.8#53
Non-authoritative answer:
206.219.58.216.in-addr.arpa     name = lga25s40-in-f14.1e100.net.
206.219.58.216.in-addr.arpa     name = lga25s40-in-f14.1e100.net.
206.219.58.216.in-addr.arpa     name = lga25s40-in-f206.1e100.net.
206.219.58.216.in-addr.arpa     name = lga25s40-in-f206.1e100.net.

查詢特定的DNS服務器

還可以查詢特定的DNS服務器。需要為名稱服務器IP地址或域名傳遞其他參數(shù)。例如,要查詢到8.8.4.4名稱服務器,使用的是以下命令。

# nslookup google.com 8.8.4.4
Server:         8.8.4.4
Address:        8.8.4.4#53
Non-authoritative answer:
Name:   google.com
Address: 216.58.219.206

查找域的SOA記錄

使用nslookup查找任何域的SOA(授權開始)記錄。例如,要查找域google.com的SOA記錄,可以使用以下命令。需要指定type-type=soa作為命令行參數(shù)。

# nslookup -type=soa google.com
Server:         8.8.8.8
Address:        8.8.8.8#53
Non-authoritative answer:
google.com
        origin = ns4.google.com
        mail addr = dns-admin.google.com
        serial = 159912615
        refresh = 900
        retry = 900
        expire = 1800
        minimum = 60
Authoritative answers can be found from:

origin:信息來源的權威。

mail addr:域管理員的電子郵件地址(第一個點代表電子郵件地址中的@符號)。

serial:域的區(qū)域的修訂數(shù)據(jù),格式為YYYYMMDDNN。

refresh:輔助名稱服務器將檢查主名稱服務器以獲取區(qū)域的更新版本的referh間隔(以秒為單位)。

retry:在嘗試失敗后嘗試重新連接到主名稱服務器之前,等待次名稱服務器的時間。

expire:輔助名稱服務器緩存過期的時間(以秒為單位)。

minimum:如果自上次刷新以來沒有經(jīng)過時間,則不應刷新輔助名稱服務器的緩存的時間(以秒為單位)。

查找域的MX記錄

您還可以查詢任何域的MX(郵件交換)記錄,這些域記錄負責電子郵件的傳遞。

# nslookup -query=mx google.com
Server:         8.8.8.8
Address:        8.8.8.8#53
Non-authoritative answer:
google.com      mail exchanger = 10 aspmx.l.google.com.
google.com      mail exchanger = 30 alt2.aspmx.l.google.com.
google.com      mail exchanger = 50 alt4.aspmx.l.google.com.
google.com      mail exchanger = 40 alt3.aspmx.l.google.com.
google.com      mail exchanger = 20 alt1.aspmx.l.google.com.
Authoritative answers can be found from:

查找域的TXT記錄

TXT記錄對于多種類型的記錄(如DKIM、SPF等)很有用。您可以使用下面的命令查找為任何域配置的所有TXT記錄。

# nslookup -query=txt google.com
Server:         8.8.8.8
Address:        8.8.8.8#53
Non-authoritative answer:
google.com      text = "v=spf1 include:_spf.google.com ~all"
Authoritative answers can be found from:

查找域的所有記錄

使用-query=any列出任何域的所有記錄。

# nslookup -query=any google.com
Server:         8.8.8.8
Address:        8.8.8.8#53
Non-authoritative answer:
Name:   google.com
Address: 216.58.219.206
google.com      has AAAA address 2607:f8b0:4006:80e::200e
google.com      mail exchanger = 20 alt1.aspmx.l.google.com.
google.com      mail exchanger = 40 alt3.aspmx.l.google.com.
google.com      nameserver = ns2.google.com.
google.com      nameserver = ns4.google.com.
google.com      nameserver = ns3.google.com.
google.com      rdata_257 = 0 issue "pki.goog"
google.com      mail exchanger = 30 alt2.aspmx.l.google.com.
google.com      mail exchanger = 10 aspmx.l.google.com.
google.com      mail exchanger = 50 alt4.aspmx.l.google.com.
google.com      text = "v=spf1 include:_spf.google.com ~all"
google.com      nameserver = ns1.google.com.
google.com      rdata_257 = 0 issue "symantec.com"
google.com
        origin = ns2.google.com
        mail addr = dns-admin.google.com
        serial = 159912615
        refresh = 900
        retry = 900
        expire = 1800
        minimum = 60
Authoritative answers can be found from:

Nslookup在交互模式下

我們也可以在交互模式中使用nslookup。要進入交互模式,請在控制臺上輸入nslookup,然后按Enter。將得到nslookup提示,如>。在這里,可以運行相同的查詢并從DNS服務器獲取域的信息。為了更好的理解,在命令之間添加了注釋。

root@tecadmin:~#nslookup
### Type domain name to get information from dns server 
> google.com
Server:         8.8.8.8
Address:        8.8.8.8#53

Non-authoritative answer:
Name:   google.com
Address: 172.217.10.46

### Set the another specific dns server to query. 
> server 8.8.4.4 
Default server: 8.8.4.4
Address: 8.8.4.4#53

### Again try to get the dns information, This time nslookup connects to specified dns server. 
> google.com 
Server:         8.8.4.4
Address:        8.8.4.4#53

Non-authoritative answer:
Name:   google.com
Address: 172.217.10.46

### Set the query type. for example to get MX information set query=mx 
> set query=mx 

### Again try to get the dns information, This time nslookup will show MX information for domain 
> google.com 
Server:         8.8.4.4
Address:        8.8.4.4#53

Non-authoritative answer:
google.com      mail exchanger = 30 alt2.aspmx.l.google.com.
google.com      mail exchanger = 50 alt4.aspmx.l.google.com.
google.com      mail exchanger = 40 alt3.aspmx.l.google.com.
google.com      mail exchanger = 10 aspmx.l.google.com.
google.com      mail exchanger = 20 alt1.aspmx.l.google.com.

Authoritative answers can be found from:

上述就是小編為大家分享的如何使用Linux nslookup命令幫助和DNS查找了,如果剛好有類似的疑惑,不妨參照上述分析進行理解。如果想知道更多相關知識,歡迎關注創(chuàng)新互聯(lián)成都網(wǎng)站設計公司行業(yè)資訊頻道。

另外有需要云服務器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。

網(wǎng)頁標題:如何使用Linuxnslookup命令幫助和DNS查找-創(chuàng)新互聯(lián)
文章起源:http://muchs.cn/article8/dsedip.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供面包屑導航、做網(wǎng)站、商城網(wǎng)站、搜索引擎優(yōu)化、全網(wǎng)營銷推廣、Google

廣告

聲明:本網(wǎng)站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)

微信小程序開發(fā)