DNS解析工具--nslookup和dig使用


1、nslookup使用

[root@master ~]# nslookup
> server 8.8.8.8    #指定域名服務器
Default server: 8.8.8.8
Address: 8.8.8.8#53
> www.baidu.com
Server: 8.8.8.8
Address: 8.8.8.8#53

Non-authoritative answer:
www.baidu.com canonical name = www.a.shifen.com.
www.a.shifen.com canonical name = www.wshifen.com.
Name: www.wshifen.com
Address: 103.235.46.39     #解析結果


2、dig的使用

yum -y install bind-utils  #安裝dig命令

格式如下:
@:來指定域名服務器
-t :指定要解析的類型
A:為解析類型,A記錄

[root@master ~]# dig -t A www.baidu.com @8.8.8.8

; <<>> DiG 9.9.4-RedHat-9.9.4-73.el7_6 <<>> -t A www.baidu.com @8.8.8.8
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55539
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;www.baidu.com. IN A

;; ANSWER SECTION:
www.baidu.com. 1149 IN CNAME www.a.shifen.com.
www.a.shifen.com. 8 IN CNAME www.wshifen.com.
www.wshifen.com. 31 IN A 103.235.46.39    #解析結果

;; Query time: 54 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: 四 3月 21 14:45:16 CST 2019
;; MSG SIZE rcvd: 111


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM