Linux Terminal Command: nslookup
The nslookup command is an essential tool in Network Utilities. In this tutorial, we will explore what nslookup does, look at everyday examples, and cover advanced options to supercharge your command-line workflow.
Concept & Explanation
The nslookup command queries DNS servers to translate domains to IP addresses or vice versa.
Common Options & Syntax
nslookup [options] [arguments]
Here are the most common flags used with nslookup:
- Simple Usage: Basic default commands.
- Detailed View: Shows diagnostic information.
- Advanced Actions: Can chain parameters for scripting.
1. Interactive Example (Simple)
Here is how most people run the command:
# Example
nslookup google.com
What it does: Performs a DNS lookup for ‘google.com’.
2. Power-User Example (Advanced)
For scripting and advanced diagnostics, use this configuration:
# Advanced
nslookup -type=mx google.com 8.8.8.8
What it does: Queries Google DNS (8.8.8.8) to locate the Mail Exchange (MX) records for ‘google.com’.
⚙️ Warning & Common Pitfalls
[!WARNING]
nslookupis a legacy tool. For advanced debugging, usediginstead.
🔗 Related Commands
Here are some related posts on cli_tty1 you might want to check out:
- dig : DNS lookup utility.