要查詢DNS伺服器的版本,
可使用nslookup或dig指令來查詢:
#nslookup -q=txt -class=chaos version.bind xxx.xxx.xxx.xxx
或
#dig txt chaos version.bind @xxx.xxx.xxx.xxx
其中xxx.xxx.xxx.xxx是DNS伺服器的IP位址。
例1:
# nslookup -q=txt -class=chaos version.bind xxx.xxx.xxx.xxx
;; Warning: query response not set
;; Warning: Message parser reports malformed message packet.
Server: xxx.xxx.xxx.xxx
Address: xxx.xxx.xxx.xxx#53
version.bind text = “Microsoft DNS 6.1.7601 (1DB14556)”
例2:
# nslookup -q=txt -class=chaos version.bind yyy.yyy.yyy.yyy
Server: yyy.yyy.yyy.yyy
Address: yyy.yyy.yyy.yyy#53
version.bind text = “9.3.6-P1-RedHat-9.3.6-4.P1.el5_4.2”
例3:
# nslookup -q=txt -class=chaos version.bind zzz.zzz.zzz.zzz
Server: zzz.zzz.zzz.zzz
Address: zzz.zzz.zzz.zzz#53
version.bind text = “9.3.2”
例4:
# dig txt chaos version.bind @xxx.xxx.xxx.xxx
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-20.P1.el5 <<>> txt chaos version.bind @xxx.xxx.xxx.xxx
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38656
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;version.bind. CH TXT
;; ANSWER SECTION:
version.bind. 0 CH TXT “9.3.6-P1-RedHat-9.3.6-4.P1.el5_4.2”
;; AUTHORITY SECTION:
version.bind. 0 CH NS version.bind.
;; Query time: 5 msec
;; SERVER: xxx.xxx.xxx.xxx#53(xxx.xxx.xxx.xxx)
;; WHEN:
;; MSG SIZE rcvd: 91
例5:
# dig txt chaos version.bind @yyy.yyy.yyy.yyy
;; Warning: Message parser reports malformed message packet.
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-20.P1.el5 <<>> txt chaos version.bind @yyy.yyy.yyy.yyy
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19170
;; flags: aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;version.bind. CH TXT
;; ANSWER SECTION:
version.bind. 1476526080 IN TXT “Microsoft DNS 6.1.7601 (1DB14556)”
;; Query time: 8 msec
;; SERVER: yyy.yyy.yyy.yyy#53(yyy.yyy.yyy.yyy)
;; WHEN:
;; MSG SIZE rcvd: 76
例6:
# dig txt chaos version.bind @zzz.zzz.zzz.zzz
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.2 <<>> txt chaos version.bind @zzz.zzz.zzz.zzz
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44624
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
;; WARNING: recursion requested but not available
;; QUESTION SECTION:
;version.bind. CH TXT
;; ANSWER SECTION:
version.bind. 0 CH TXT “9.3.2”
;; AUTHORITY SECTION:
version.bind. 0 CH NS version.bind.
;; Query time: 8 msec
;; SERVER: zzz.zzz.zzz.zzz#53(zzz.zzz.zzz.zzz)
;; WHEN:
;; MSG SIZE rcvd: 62