Breaking News

Home / Networking / Digging for DNS answers on Linux

Digging for DNS answers on Linux

Dig is a powerful and flexible tool for interrogating DNS name servers. It performs DNS lookups and displays the answers that are returned from the name servers that were involved in the process along with details related to the search. System and DNS administrators often use dig to help troubleshoot DNS problems. In this post, we’ll take a deep dive into how it works and see what it can tell us.

To get started, it’s helpful to have a good mental image of how DNS or domain name system works. It’s a critical part of the global Internet because it provides a way to look up and, thereby, connect with servers around the world. You can think of it as the Internet’s address book and any system that is properly connected to the Internet should be able to use it to look up the IP address of any properly registered server.

Getting started with dig

The dig tool is generally installed on Linux systems by default. Here’s an example of a dig command with a little annotation:

$ dig www.networkworld.com

; <<>> DiG 9.16.1-Ubuntu <<>> www.networkworld.com <== version of dig you’re using
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6034
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:				<== details on your query
;www.networkworld.com.          IN      A	

;; ANSWER SECTION:				<== results
www.networkworld.com.   3568    IN      CNAME   idg.map.fastly.net.
idg.map.fastly.net.     30      IN      A       151.101.250.165

;; Query time: 36 msec				<== query time
;; SERVER: 127.0.0.53#53(127.0.0.53)		<== local caching resolver
;; WHEN: Fri Jul 24 19:11:42 EDT 2020           <== date and time of inquiry
;; MSG SIZE  rcvd: 97                           <== bytes returned

If you get a response like this, is it good news?  The short answer is “yes”. You got a reply in a timely manner. The status field (status: NOERROR) shows there were no problems. You’re connecting to a name server that is able to supply the requested information and getting a reply that tells you some important details about the system you’re inquiring about. In short, you’ve verified that your system and the domain name system are getting along just fine.

Other possible status indicators include:

SERVFAIL – The name that was queried exists, but no data is available or available data is invalid.

Copyright © 2020 IDG Communications, Inc.


Source link

About admin

Check Also

How to get a better view of Wireshark capture files with Brim

If you’re a network admin who depends on Wireshark, you’re going to want to use ...

Leave a Reply

Your email address will not be published. Required fields are marked *