Linux下的host命令
分析域名查询工具,测试域名系统工作是否正常
语法:
host (选项) (参数)
选项:
- -a : 显示详细的DNS信息
- -c<类型> : 指定查询类型,默认值为“IN”
- -C : 查询指定主机的完整的SOA记录
- -r : 在查询域名时,不使用递归的查询方式
- -t<类型> : 指定查询的域名信息类型
- -v : 显示指令执行的详细信息
- -w : 如果域名系统服务器没有给出应答信息,则总是等待,直到域名服务器给出应答
- -W<时间> : 指定域名查询最长时间,如果在指定时间内域名服务器没有给出应答信息,则退出指令
- -4 : 使用IPv4
- -6 : 使用IPv6
参数:
- 主机: 指定要查询信息的主机信息
CenOs下使用失败,尝试
yum install bind-utils
➜ ~ host www.baidu.com
zsh: command not found: host
➜ ~ yum install bind-utils
➜ ~ host -h
host: illegal option -- h
Usage: host [-aCdilrTvVw] [-c class] [-N ndots] [-t type] [-W time]
[-R number] [-m flag] hostname [server]
-a is equivalent to -v -t ANY
-c specifies query class for non-IN data
-C compares SOA records on authoritative nameservers
-d is equivalent to -v
-i IP6.INT reverse lookups
-l lists all hosts in a domain, using AXFR
-m set memory debugging flag (trace|record|usage)
-N changes the number of dots allowed before root lookup is done
-r disables recursive processing
-R specifies number of retries for UDP packets
-s a SERVFAIL response should stop query
-t specifies the query type
-T enables TCP/IP mode
-v enables verbose output
-V print version number and exit
-w specifies to wait forever for a reply
-W specifies how long to wait for a reply
-4 use IPv4 query transport only
-6 use IPv6 query transport only
➜ ~ host www.baidu.com
www.baidu.com is an alias for www.a.shifen.com.
www.a.shifen.com has address 14.215.177.38
www.a.shifen.com has address 14.215.177.39