Beginner Package: bind9-dnsutils / bind-utils

dig

Query DNS records directly against a nameserver.

Syntax

dig [@server] name [type]

Description

dig is the standard tool for troubleshooting DNS. It sends a query to a specified (or system-default) nameserver and prints the full response, including the answer, authority and additional sections, plus timing information. It is the first command most administrators reach for when a domain will not resolve.

Examples

dig example.com
Look up the A record for example.com using the system resolver
dig @8.8.8.8 example.com MX
Query Google's resolver directly for MX (mail) records
dig +short example.com
Print only the resolved IP address, no extra detail
dig -x 192.0.2.10
Perform a reverse lookup (PTR record) for an IP address
Package is dnsutils on Debian/Ubuntu, bind-utils on RHEL/Fedora.

Applies to

Ubuntu Debian Linux Mint RHEL CentOS / Rocky / AlmaLinux Fedora Arch Linux openSUSE Alpine Linux