• nslookup与dig


    在进行DNS拨测时,我们常用的命令为nslookup和dig工具进行拨测

    nslookup

    是windows上默认自带的DNS拨测工具

    nslookup domain-name server-address

    当没有指定server-address时,nslookup工具会读系统网络配置的TCP/IP属性中配置的DNS服务器的地址。 

    具体的使用方法可在windows的cmd命令行中输入nslookup回车,然后输入help获得帮助信息。

    > help
    命令:   (标识符以大写表示,[] 表示可选)
    NAME            - 打印有关使用默认服务器的主机/域 NAME 的信息
    NAME1 NAME2     - 同上,但将 NAME2 用作服务器
    help or ?       - 打印有关常用命令的信息
    set OPTION      - 设置选项
        all                 - 打印选项、当前服务器和主机
        [no]debug           - 打印调试信息
        [no]d2              - 打印详细的调试信息
        [no]defname         - 将域名附加到每个查询
        [no]recurse         - 询问查询的递归应答
        [no]search          - 使用域搜索列表
        [no]vc              - 始终使用虚拟电路
        domain=NAME         - 将默认域名设置为 NAME
        srchlist=N1[/N2/.../N6] - 将域设置为 N1,并将搜索列表设置为 N1、N2 等
        root=NAME           - 将根服务器设置为 NAME
        retry=X             - 将重试次数设置为 X
        timeout=X           - 将初始超时间隔设置为 X 秒
        type=X              - 设置查询类型(如 A、AAAA、A+AAAA、ANY、CNAME、MX、
                              NS、PTR、SOA 和 SRV)
        querytype=X         - 与类型相同
        class="X"             - 设置查询类(如 IN (Internet)和 ANY)
        [no]msxfr           - 使用 MS 快速区域传送
        ixfrver=X           - 用于 IXFR 传送请求的当前版本
    server NAME     - 将默认服务器设置为 NAME,使用当前默认服务器
    lserver NAME    - 将默认服务器设置为 NAME,使用初始服务器
    root            - 将当前默认服务器设置为根服务器
    ls [opt] DOMAIN [> FILE] - 列出 DOMAIN 中的地址(可选: 输出到文件 FILE)
        -a          -  列出规范名称和别名
        -d          -  列出所有记录
        -t TYPE     -  列出给定 RFC 记录类型(例如 A、CNAME、MX、NS 和 PTR 等)
                       的记录
    view FILE           - 对 'ls' 输出文件排序,并使用 pg 查看
    exit            - 退出程序

    dig

    是Linux默认自带的DNS拨测工具

    dig @server-address domain-name

    当没有指定server-address时,dig工具会到系统的/etc/resolv.conf中读取系统配置的DNS服务器地址。

    具体的使用方法可在Linux的命令行输入dig -h获得帮助信息。

    # dig -h
    Usage:  dig [@global-server] [domain] [q-type] [q-class] {q-opt}
                {global-d-opt} host [@local-server] {local-d-opt}
                [ host [@local-server] {local-d-opt} [...]]
    Where:  domain    is in the Domain Name System
            q-class  is one of (in,hs,ch,...) [default: in]
            q-type   is one of (a,any,mx,ns,soa,hinfo,axfr,txt,...) [default:a]
                     (Use ixfr=version for type ixfr)
            q-opt    is one of:
                     -x dot-notation     (shortcut for reverse lookups)
                     -i                  (use IP6.INT for IPv6 reverse lookups)
                     -f filename         (batch mode)
                     -b address[#port]   (bind to source address/port)
                     -p port             (specify port number)
                     -q name             (specify query name)
                     -t type             (specify query type)
                     -c class            (specify query class)
                     -k keyfile          (specify tsig key file)
                     -y [hmac:]name:key  (specify named base64 tsig key)
                     -4                  (use IPv4 query transport only)
                     -6                  (use IPv6 query transport only)
                     -m                  (enable memory usage debugging)
            d-opt    is of the form +keyword[=value], where keyword is:
                     +[no]vc             (TCP mode)
                     +[no]tcp            (TCP mode, alternate syntax)
                     +time=###           (Set query timeout) [5]
                     +tries=###          (Set number of UDP attempts) [3]
                     +retry=###          (Set number of UDP retries) [2]
                     +domain=###         (Set default domainname)
                     +bufsize=###        (Set EDNS0 Max UDP packet size)
                     +ndots=###          (Set NDOTS value)
                     +edns=###           (Set EDNS version)
                     +[no]search         (Set whether to use searchlist)
                     +[no]showsearch     (Search with intermediate results)
                     +[no]defname        (Ditto)
                     +[no]recurse        (Recursive mode)
                     +[no]ignore         (Don't revert to TCP for TC responses.)
                     +[no]fail           (Don't try next server on SERVFAIL)
                     +[no]besteffort     (Try to parse even illegal messages)
                     +[no]aaonly         (Set AA flag in query (+[no]aaflag))
                     +[no]adflag         (Set AD flag in query)
                     +[no]cdflag         (Set CD flag in query)
                     +[no]cl             (Control display of class in records)
                     +[no]cmd            (Control display of command line)
                     +[no]comments       (Control display of comment lines)
                     +[no]question       (Control display of question)
                     +[no]answer         (Control display of answer)
                     +[no]authority      (Control display of authority)
                     +[no]additional     (Control display of additional)
                     +[no]stats          (Control display of statistics)
                     +[no]short          (Disable everything except short
                                          form of answer)
                     +[no]ttlid          (Control display of ttls in records)
                     +[no]all            (Set or clear all display flags)
                     +[no]qr             (Print question before sending)
                     +[no]nssearch       (Search all authoritative nameservers)
                     +[no]identify       (ID responders in short answers)
                     +[no]trace          (Trace delegation down from root)
                     +[no]dnssec         (Request DNSSEC records)
                     +[no]nsid           (Request Name Server ID)
                     +[no]sigchase       (Chase DNSSEC signatures)
                     +trusted-key=####   (Trusted Key when chasing DNSSEC sigs)
                     +[no]topdown        (Do DNSSEC validation top down mode)
                     +[no]multiline      (Print records in an expanded format)
                     +[no]onesoa         (AXFR prints only one soa record)
            global d-opts and servers (before host name) affect all queries.
            local d-opts and servers (after host name) affect only that lookup.
            -h                           (print help and exit)
            -v                           (print version and exit)

    学无止境,你说呢?
  • 相关阅读:
    PHP技巧通过COM使用ADODB
    PHP开发环境安装配置全攻略
    散列表
    poj Antiprime Sequences
    HDU 2011 菜鸟杯
    UVA The ? 1 ? 2 ? ... ? n = k problem
    poj 3126 Prime Path
    uva 699 The Falling Leaves
    UVA Steps
    poj 1426 Find The Multiple
  • 原文地址:https://www.cnblogs.com/moumouLiu/p/5481922.html
Copyright © 2020-2023  润新知