Linux basic commands --- host domain name query tool

host

      host is a commonly used DNS query tool, often used to query domain name check domain name resolution is correct.

      Scope of this command: RedHat, RHEL, Ubuntu, CentOS, Fedora.

 

1 , grammar

      host [ options] name [server]

 

2 , the list of options

Options

Explanation

-a

All information queries

-c

Set the query type

-C

Discover a complete SOA record

-d | -v

Show process

-l

List mode

-t

Select the query type: CNAME NS SOA SIG KEY AXFR

-w

Wait forever

-W

Set Wait Timeout

 

3 , examples

1) Check Domain

[root@localhost ~]# host www.baidu.com                //查询域名信息,显示别名和ip

www.baidu.com is an alias for www.a.shifen.com.

www.a.shifen.com has address 111.13.100.91

www.a.shifen.com has address 111.13.100.92 

2) all information inquiry

[root@localhost ~]# host -a www.baidu.com             //查询域名的所有信息

Trying "www.baidu.com"

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 51953

;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 1, ADDITIONAL: 0

 

;; QUESTION SECTION:

;www.baidu.com.      IN  ANY

 

;; ANSWER SECTION:

www.baidu.com.    696 IN  CNAME  www.a.shifen.com.

www.a.shifen.com. 22  IN  A   111.13.100.91

www.a.shifen.com. 22  IN  A   111.13.100.92

 

;; AUTHORITY SECTION:

a.shifen.com.     60  IN  SOA ns1.a.shifen.com. baidu_dns_master.baidu.com. 1810060004 5 5 2592000 3600

 

Received 147 bytes from 172.20.10.1#53 in 10 ms 

 

     

      Made a study of the Linux platform, now came up with a prototype, you can use the reference
      link: https: //pan.baidu.com/s/1GOLVU2CbpBNGtunztVpaCQ Password: n7bk

      

Guess you like

Origin www.cnblogs.com/wj78080458/p/10849418.html