How to Use dig

The dig(1) program is distributed with the BIND name server software. It is a command-line program that permits users to easily look up hosts and addresses in the same way sendmail does. We won’t cover all the bells and whistles of dig(1) here (read the online manual); instead, we will provide you with only the four basic commands you need to use dig(1):

% dig host.domain                ← look up a host by name (§9.4.1 on page 339)
% dig -x IPaddress               ← reverse-look-up an IP address (§9.4.2 on page
341)
% dig mx host.domain             ← look up MX records (§9.4.3 on page 342)
% dig @nameserver host.domain    ← use a different name server (§9.4.4 on page
343)

After you have learned these basic commands, you will wonder how you ever lived without this program.

Get sendmail, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.