验证DNS的命令
试验环境
域名服务器: dns3sv.te 192.168.1.65
数据服务器1:bsdb1.te 192.168.15.1
数据服务器2:bsdb2.te 192.168.15.2
DNS检验命令有host,nslookup,dig,ping等。
1.host命令
[root@dns3sv named]# host dns3sv.te
dns3sv.te has address 192.168.1.65
[root@dns3sv named]# host 192.168.1.65
65.1.168.192.in-addr.arpa domain name pointer dns3sv.te.
[root@dns3sv named]# host bsdb1.te
bsdb1.te has address 192.168.15.1
[root@dns3sv named]# host 192.168.15.2
2.15.168.192.in-addr.arpa domain name pointer bsdb2.te.
2.nslookup命令
[root@dns3sv ~]# nslookup zsdb1.te
Server: 192.168.1.65
Address: 192.168.1.65#53
Name: zsdb1.te
Address: 192.168.15.5
[root@dns3sv ~]# nslookup zsdb1.ab
Server: 192.168.1.65
Address: 192.168.1.65#53
** server can't find zsdb1.ab: REFUSED
3.dig命令
[root@dns3sv ~]# dig zsdb2.te
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> zsdb2.te
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24888
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; QUESTION SECTION:
;zsdb2.te. IN A
;; ANSWER SECTION:
zsdb2.te. 604800 IN A 192.168.15.6
;; AUTHORITY SECTION:
bj. 604800 IN NS dns3sv.te.
;; ADDITIONAL SECTION:
dns3sv.te. 604800 IN A 192.168.1.65
;; Query time: 0 msec
;; SERVER: 192.168.1.65#53(192.168.1.65)
;; WHEN: Thu Sep 11 09:48:06 2014
;; MSG SIZE rcvd: 81
// 604800秒=7天
// 259200秒=3天
[root@dns3sv ~]# dig .te
dig: '.te' is not a legal name (unexpected end of input)
[root@dns3sv ~]# dig A1.te
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> A1.te
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 13154
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; WARNING: recursion requested but not available
;; QUESTION SECTION:
;A1.te. IN A
;; AUTHORITY SECTION:
bj. 259200 IN SOA dns3sv.te. root.te. 2014091001 21600 10800 604800 259200
;; Query time: 0 msec
;; SERVER: 192.168.1.65#53(192.168.1.65)
;; WHEN: Thu Sep 11 09:49:40 2014
;; MSG SIZE rcvd: 71
4.ping命令
[root@dns3sv ~]# ping dns3sv.te
PING dns3sv (192.168.1.65) 56(84) bytes of data.
64 bytes from dns3sv (192.168.1.65): icmp_seq=1 ttl=64 time=0.027 ms
64 bytes from dns3sv (192.168.1.65): icmp_seq=2 ttl=64 time=0.016 ms
64 bytes from dns3sv (192.168.1.65): icmp_seq=3 ttl=64 time=0.016 ms
64 bytes from dns3sv (192.168.1.65): icmp_seq=4 ttl=64 time=0.015 ms
^C
// Ok
来源:51CTO
作者:lujj45
链接:https://blog.51cto.com/147655/2459711