Query DNS records and troubleshoot name resolution quickly from the shell using nslookup. 18.04.2026 | reading time: 2 min Want to peek behind DNS and see who answers name queries? Use `nslookup` to query name servers, inspect records, and find whether a resolver is answering from cache or authoritatively; it is fast, available on most Linux systems, and a great first step for diagnosis. A quick lookup Run a simple query with `nslookup example.com` and observe the reply; typical output includes the server and address like `Server: 8.8.8.8 Address: 8.8.8.8#53` and the record like `Non-authoritative answer: Name: example.com Address: 93.184.216.34`; to reverse-resolve run `nslookup 93.184.216.34` which will return the PTR name when present. Digging deeper Query a specific DNS server with `nslookup example.com 1.1.1.1` or ask for a record type directly with `nslookup -type=MX example.com`; start interactive mode by running `nslookup` alone, then use commands like `set type=TXT` and enter a hostname to iterate quickly through different record types and servers. When nslookup helps Use `nslookup` to check which DNS server a host uses, to confirm basic A/AAAA/MX/TXT/PTR answers, and to reproduce a client's lookup against an alternate resolver; it is ideal for quick, ad-hoc checks but remember that its output format can vary across implementations and it is sometimes considered less script-friendly than other tools. Other DNS tools For deeper analysis prefer `dig` for verbose and parseable responses, use `host` for compact lookups, and capture on-the-wire traffic with `tcpdump -n port 53` to see actual DNS packets and timing; each tool complements `nslookup` depending on whether readability, scripting or packet inspection is required. Next steps Practice the commands on live names and experiment with different servers and record types to build intuition; to turn knowledge into certification consider advanced Linux study and exam preparation like CompTIA Linux+ or LPIC-1, and use intensive courses at bitsandbytes.academy to prepare rigorously. Join Bits & Bytes Academy First class LINUX exam preparation. network utilities troubleshooting