10.20 host:域名查询工具

host命令

是用于查询DNS的工具,它可以将指定主机名称转换为IP地址。

host命令的参数选项及说明


-a 显示详细的DNS信息
-t 指定查询的域名信息类型,可以是“A”、“ALL”、“MX”和“NS”等

DNS查询


[root@cs6 ~]# host www.wenyule.top
www.wenyule.top has address 213.232.105.22

查询详细信息

[root@cs6 ~]# host -a www.wenyule.top
Trying "www.wenyule.top"
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53480
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 18

;; QUESTION SECTION:
;www.wenyule.top. IN ANY

;; ANSWER SECTION:
www.wenyule.top. 5 IN A 213.232.105.22

;; AUTHORITY SECTION:
wenyule.top. 5 IN NS dns17.hichina.com.
wenyule.top. 5 IN NS dns18.hichina.com.

;; ADDITIONAL SECTION:
dns17.hichina.com. 5 IN A 140.205.81.17
dns17.hichina.com. 5 IN A 140.205.81.27
dns17.hichina.com. 5 IN A 106.11.141.117
dns17.hichina.com. 5 IN A 106.11.141.127
dns17.hichina.com. 5 IN A 106.11.211.57
dns17.hichina.com. 5 IN A 106.11.211.67
dns17.hichina.com. 5 IN A 140.205.41.17
dns17.hichina.com. 5 IN A 140.205.41.27
dns17.hichina.com. 5 IN AAAA 2400:3200:2000:36::1
dns18.hichina.com. 5 IN A 106.11.211.68
dns18.hichina.com. 5 IN A 140.205.41.18
dns18.hichina.com. 5 IN A 140.205.41.28
dns18.hichina.com. 5 IN A 140.205.81.18
dns18.hichina.com. 5 IN A 140.205.81.28
dns18.hichina.com. 5 IN A 106.11.141.118
dns18.hichina.com. 5 IN A 106.11.141.128
dns18.hichina.com. 5 IN A 106.11.211.58
dns18.hichina.com. 5 IN AAAA 2400:3200:2000:37::1

Received 412 bytes from 10.0.0.2#53 in 31 ms


指定DNS服务器查询

[root@cs6 ~]# host -a www.wenyule.top 8.8.8.8
Trying "www.wenyule.top"
Using domain server:
Name: 8.8.8.8
Address: 8.8.8.8#53
Aliases:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20333
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 8, ADDITIONAL: 8

;; QUESTION SECTION:
;www.wenyule.top. IN ANY

;; ANSWER SECTION:
www.wenyule.top. 600 IN A 213.232.105.22

;; AUTHORITY SECTION:
top. 48532 IN NS j.zdnscloud.com.
top. 48532 IN NS a.zdnscloud.com.
top. 48532 IN NS d.zdnscloud.com.
top. 48532 IN NS g.zdnscloud.com.
top. 48532 IN NS c.zdnscloud.com.
top. 48532 IN NS f.zdnscloud.com.
top. 48532 IN NS i.zdnscloud.com.
top. 48532 IN NS b.zdnscloud.com.

;; ADDITIONAL SECTION:
a.zdnscloud.com. 703 IN A 203.99.24.1
b.zdnscloud.com. 2433 IN A 203.99.25.1
c.zdnscloud.com. 2366 IN A 203.99.26.1
d.zdnscloud.com. 769 IN A 203.99.27.1
f.zdnscloud.com. 2145 IN A 114.67.46.12
g.zdnscloud.com. 1039 IN A 42.62.2.16
i.zdnscloud.com. 175 IN AAAA 2401:8d00:1::1
j.zdnscloud.com. 1278 IN AAAA 2401:8d00:2::1

Received 342 bytes from 8.8.8.8#53 in 56 ms

按类进行查询

[root@cs6 ~]# host -t MX wenyule.top
wenyule.top mail is handled by 5 mxn.mxhichina.com.
wenyule.top mail is handled by 10 mxw.mxhichina.com.

-

posted @ 2019-05-09 16:07  Fadewalk  阅读(1491)  评论(0编辑  收藏  举报