Get the App
SLTechnology News&Howtos  ›  Servers  › 

The usage of the Linux basic command dig

Shulou Source: shulou.com Published: 2022-06-01 12:37:41 10月03日 Update

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

Tags: Query command foundation content domain name learning practical deeper host information interest parameter address instance practicality practice tool simple operation file method Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Shulou Technology MySQL Microsoft macOS