Most of the time, your operating system handles all lookups for you. But as an IT support specialist, sometimes it can be useful to run these yourself.

Nslookup

The most common tool is known as the nslookup, and it’s available on all three of the operating systems.

You execute nslookup command with the host name following it, and the output displays what server was used to perform teh request and the resolution result.

Let’s say you needed to know the IP addresses for twitter.com, you would just enter nslookup twitter.com and the a record would be returned.

Interactive

It includes an interactive mode that lets you set additional options and run lots of queries in a row. To start an interactive nslookup session, you just enter nslookup without any hostname following it.

Untitled

You can also perform some extra configuration to help with more in-depth troubleshooting. While in interactive mode, if you type server, then an address, all the following name resolution queries will be attempted to be made using that server instead of the default name server.

You can also enter set type equals followed by resource record type. By default, nslookup will return A records, but this lets you explicitly ask for QWERTY or MX, or even text records associated with the host.

If you really want to see exactly what’s going on, you can enter set debug. This will allow the tool to display the full response packets, including any intermediary requests and all of their contents.

Warning, this is a lot of data and can contain details like the TTL left if it’s a cached response all the way to the serial number of the zone file the request was made against.