1、安装方法
yum install bind-utils
2、常用命令
2.1 直接dig域名,根据自身网络的dns获取域名解析信息
root@basic harbor]# dig www.mikezhu.tech
; <<>> DiG 9.9.4-RedHat-9.9.4-74.el7_6.2 <<>> www.mikezhu.tech ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33969 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;www.mikezhu.tech. IN A
;; ANSWER SECTION: www.mikezhu.tech. 600 IN A 192.168.137.10
;; Query time: 347 msec ;; SERVER: 202.96.209.133#53(202.96.209.133) ;; WHEN: Mon Aug 05 10:39:59 CST 2019 ;; MSG SIZE rcvd: 61
[root@basic harbor]#
2.2 dig @serverip 指定dns服务器进行解析
[root@basic harbor]# dig @8.8.8.8 www.mikezhu.tech
; <<>> DiG 9.9.4-RedHat-9.9.4-74.el7_6.2 <<>> @8.8.8.8 www.mikezhu.tech ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57221 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 512 ;; QUESTION SECTION: ;www.mikezhu.tech. IN A
;; ANSWER SECTION: www.mikezhu.tech. 599 IN A 192.168.137.10
;; Query time: 87 msec ;; SERVER: 8.8.8.8#53(8.8.8.8) ;; WHEN: Mon Aug 05 10:41:48 CST 2019 ;; MSG SIZE rcvd: 61
[root@basic harbor]#
后续命令待续