Linux basic commands --- nslookup Query domain tool

nslookup

nslookup is a tool to query the DNS domain name, it has interactive and non-interactive modes of operation.

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

 

1 , grammar

nslookup [-option]  [name | -] [server]

 

2 , after entering the interactive mode command has the following

command

Explanation

host

The host information queries

server domain

Change server

exit

drop out

setkeyword=value

Sets the specified property

All , all the attributes of print

domain = name  set the query name

port = value  change server port

type = value  to change the type of query

timeout = number  set Wait Timeout

class={IN | CH | HS | ANY}

 

3 , examples

1 ) non-interactive mode queries

[root@localhost ~]# nslookup www.baidu.com

Server:           172.20.10.1

Address:         172.20.10.1#53

 

Non-authoritative answer:

www.baidu.com    canonical name = www.a.shifen.com.

Name:            www.a.shifen.com

Address: 111.13.100.91

Name:            www.a.shifen.com

Address: 111.13.100.92 

2 ) interactive mode query

[root@localhost ~]# nslookup              //交互模式

www.baidu.com                              //输入查询的域名

Server:           172.20.10.1

Address:         172.20.10.1#53

 

Non-authoritative answer:

www.baidu.com    canonical name = www.a.shifen.com.

Name:            www.a.shifen.com

Address: 111.13.100.91

Name:            www.a.shifen.com

Address: 111.13.100.92

set all                                    //打印当前所有的配置信息

Default server: 172.20.10.1

Address: 172.20.10.1#53

 

Set options:

  novc               nodebug       nod2

  search          recurse

  timeout = 0     retry = 3  port = 53

  querytype = A       class = IN

  srchlist = 

 

     

      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 blog.51cto.com/9888479/2432454