The usage of the Linux basic command dig
This article mainly explains "the usage of the Linux basic command dig". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the usage of the basic Linux command dig.
Dig
Dig is a DNS query tool, and most administrators use the dig command to solve DNS problems.
The scope of application of this command: RedHat, RHEL, Ubuntu, CentOS, Fedora.
1. Grammar
Dig [options]
2. Parameter list
Option
Description
@ server
Specify server address
-b host
Specify which host to query
-f file
Query from the specified file
-p port
Specify the port to use
-t type
Specify the type of DNS to query, such as A\ MX\ PRT
-x ip
Specify DNS if you want to query, enter ip to get the domain name
-4
Use ipv4
-6
Use ipv6
3. Examples
1) query domain name information
[root@localhost ~] # dig www.baidu.com
; DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6_4.6 www.baidu.com
;; global options: + cmd
;; Got answer:
;;-> > HEADERHEADER