• 幕客老师召集小伙伴
  • 运维高手36项修炼
  • python自动化运维项目实战
  • nginx从入门到实战
  • 阿里云与Centos7实战

DNS-客户端dns查询

客户端查询

nslookup,host,dig
========================================================

客户端指定本地DNS
[root@jeson ~]# cat /etc/resolv.conf 
nameserver 192.168.2.115
[root@jeson ~]# dig www.baidu.com
[root@jeson ~]# nslookup www.baidu.com
[root@jeson ~]# host www.baidu.com

dig (Linux)
[root@jeson ~]# dig www.126.com //使用/etc/resolv.conf设置的DNS
[root@jeson ~]# dig @192.168.2.168 www.126.com //使用指定的DNS
[root@jeson ~]# dig @192.168.2.100 www.126.com //使用指定的DNS

host (Linux)
[root@jeson ~]# host -t A www.baidu.com //正向解析,查询A记录
[root@jeson ~]# host 192.168.5.100 //反向解析,查询PTR记录
[root@jeson ~]# host www.baidu.com 192.168.5.240 //使用DNS服务器192.168.5.240解析
[root@jeson ~]# host -t SOA baidu.com //查询某个域的SOA 
baidu.com has SOA record ns.baidu.com. root.baidu.com. 2013081303 3600 900 604800 86400
[root@jeson ~]# host -t NS baidu.com //查询某个域的NS
baidu.com name server ns.baidu.com.
baidu.com name server ns2.baidu.com.
[root@jeson ~]# 
[root@jeson ~]# host -t MX baidu.com //查询某个域的邮件服务器
baidu.com mail is handled by 10 mail.baidu.com.

nslookup (Linux/Windows)
[root@jeson ~]# nslookup www.baidu.com
[root@jeson ~]# nslookup 192.168.5.100

[root@jeson ~]# nslookup
> www.baidu.com
Server:         www.iaskjob.com
Address:        www.iaskjob.com#53

Name:   www.baidu.com
Address: 192.168.5.100
> 192.168.5.2
Server:         www.iaskjob.com
Address:        www.iaskjob.com#53
2.5.168.192.in-addr.arpa        name = www.baidu.com.

[root@jeson ~]# nslookup
> server 192.168.5.2 //使用临时指定的服务器解析
Default server: 192.168.5.2
Address: 192.168.5.2#53

[root@jeson ~]# nslookup
> set q=soa
> baidu.com
Server:         www.iaskjob.com
Address:        www.iaskjob.com#53

baidu.com
        origin = ns.baidu.com
        mail addr = root.baidu.com
        serial = 2013081303
        refresh = 3600
        retry = 900
        expire = 604800
        minimum = 86400
> set q=ns
> baidu.com
Server:         www.iaskjob.com
Address:        www.iaskjob.com#53

baidu.com       nameserver = ns.baidu.com.
baidu.com       nameserver = ns2.baidu.com.

[root@jeson ~]# nslookup
> set q=mx
> baidu.com
Server:         www.iaskjob.com
Address:        www.iaskjob.com#53

baidu.com       mail exchanger = 10 mail.baidu.com.
> set q=a
> www.baidu.com
Server:         www.iaskjob.com
Address:        www.iaskjob.com#53

Name:   www.baidu.com
Address: 192.168.5.100

DNS-客户端dns查询

Pingbacks已打开。

引用地址

暂无评论

发表评论