How-to: Understand DNS Commands

Fellow dinosaurs and web gurus can skip over this one; for anyone else on the sharp end of web-mastering, a quick refresher on DNS commands may be in order.

DNS commands are a way to interrogate the vital backbone of the Internet, the Domain Name System. DNS commands can be entered from a command-line interface, the dreaded command prompt, or if you're old-school; terminal. While there are websites and utilities that can front-end these for you, it helps if you know which thing you need to run to answer a particular question when:
  • troubleshooting DNS issues
  • troubleshooting web server issues

DNS Commands on Windows
Because we don't all live in Open Source heaven, it helps to know how to run these from a Command Prompt. Searching your start menu (Windows XP through 7) or start screen (Windows 8 through 10) for command or cmd should allow you to open a terminal session

nslookup: identifies domain name resolution.
ipconfig: provides an interface for local networking information for all connected Internet-capable hardware. You can view connection information, and access the local DNS cache, the temporary copy of IP addressing that allows DNS to propagate more efficiently.

ping: provides no DNS functionality, however, as an IP-packet tool, it is the easiest way to diagnose Internet connection issues by pinging an address to see not only what gets through to that address, but the response time. It's my first diagnostic tool whenever I fail to get a browser response, or a very slow one, from a URL.

DNS Commands on Linux
On almost any Linux device, go to Applications, Terminal

host: on Linux, this is the easiest way to resolve a domain name to an IP address. Host can also be used for reverse DNS, so if  you enter an IP address, the command returns the host name.

dig: an acronym, the delightfully named domain information groper, is similar to the nslookup command, but like everything Linux, can also be used as a batch command.

nslookup: on Linux the nslookup can request information from domain name servers about hosts and domains, but can also retrieve all hosts under a specific domain.

ping: like ping everywhere, this uses ICMP, or Internet Control Message Protocol to send packets and receive acknowledgements (or not) from the destination IP address.

Go forth, my faithful bloodhounds! [sorry, I'll go take my medication] RC

Image credit: Hidden variations in neuronal network, Wellcome Trust, Creative Commons