Video Walkthroughs at Superb Internet
close
Domain Name / Customer ID:

Password:

Forgot Password

All material © 1996 - 2019 Superb Internet Technologies Inc. // version-1.50.33
« Back to all videos

Query DNS Server using DIG

Query DNS Server using DIG

This tutorial will show you how to query a Domain Name System (DNS) name servers for records, and how to specify which DNS server to query, using the DIG (domain information groper) command-line tool.

  1. Using the DIG command-line tool, you can find DNS records for different domain names, such as google.com, bing.com, and hotmail.com, and you can query different DNS servers, such as Google's public DNS server."
  2. From the DIG command-line tool prompt, run "dig google.com." You will see the DIG command output.
  3. Look at the "ANSWER SECTION," which shows you the answer (it displays "A" records of google.com)
  4. Unless otherwise specified, the DIG command-line tool displays "A" records by default.
  5. You can also query specific records using DIG command, for example, a MX record.
  6. From the command prompt run "dig google.com MX."
  7. You will see that the ANSWER SECTION displays the MX records and the "ADDITIONAL SECTION" displays "A" records of Google's MX hosts.
  8. You can also query Name Servers or (NS) records. Simply use the NS type in your query. Run "dig google.com NS" at the command prompt.
  9. The output is displayed in the "ANSWER SECTION," and the "ADDITIONAL SECTION" displays "A" records of Google's name servers.
  10. If you, for example, want to know the name of some host and all you have is its external IP address, you can do it by performing a reverse DNS lookup, using "dig x".
  11. In the command prompt, run "dig x 8.8.8.8" The "ANSWER SECTION" will display the host name that belongs to the 8.8.8.8 IP address, which is one of Google's public DNS servers.
  12. If you want to use a different DNS server to perform the query, you can do it by specifying the DNS server in the command line.
  13. By default, DIG uses servers defined in the /etc/resolv.conf configuration file.
  14. If you run, "dig @8.8.8.8 bing.com," the "ANSWER SECTION" displays an "A" record for bing.com domain. In the stats section below that, "SERVER:" displays what DNS server you queried directly.
  15. You can use this method to find answers for any type of DNS records
  16. For example, you can query Google's public DNS server for a TXT record of hotmail.com domain.
  17. In the command prompt, if you run dig@8.8.8.8 hotmail.com TXT, the "ANSWER SECTION" will display hotmail's TXT records.
  18. For more information about the DIG command-line tool and a list of detailed options available, at the command prompt, run "man dig."

comments powered by Disqus