Linux and Unix dig Command Examples

Linux and Unix dig Command Examples

The dig command is a powerful tool for querying DNS (Domain Name System) servers on a network. It allows you to look up DNS records, such as A, AAAA, MX, and NS records, and can be useful for troubleshooting DNS issues or analyzing the behavior of DNS servers.

Here are some examples of how you can use the dig command on a Linux or Unix system:

  1. To look up the A record (IP address) for a domain, you can use the dig command with the +short option, which displays the DNS record in a concise format:
refer‮l:ot ‬autturi.com
dig example.com +short

This will display the IP address for example.com.

  1. To look up the MX record (mail exchange server) for a domain, you can use the dig command with the mx option:
dig example.com mx +short

This will display the mail exchange server for example.com.

  1. To look up the NS record (name server) for a domain, you can use the dig command with the ns option:
dig example.com ns +short

This will display the name servers for example.com.

  1. To look up the SOA record (start of authority) for a domain, you can use the dig command with the soa option:
dig example.com soa +short

This will display the start of authority record for example.com.

For more information about using the dig command to query DNS servers on a network, you can consult the dig documentation or seek assistance from a qualified Linux or Unix administrator.

Created Time:2017-10-29 22:09:00  Author:lautturi