Skip to content
Latchkey

nslookup Command Reference: Usage & CI Examples

nslookup queries DNS name servers for records.

nslookup is a widely available DNS lookup tool. It is less script-friendly than dig but is often present where dig is not, which makes it a useful fallback in minimal images.

Common flags and usage

  • nslookup <name>: resolve a hostname
  • nslookup <name> <server>: query a specific resolver
  • -type=MX / -type=TXT: query a record type
  • nslookup <ip>: reverse lookup
  • Output includes the answering server and address

Example

shell
nslookup api.example.com
nslookup -type=TXT example.com 8.8.8.8

In CI

Use nslookup as a quick resolution check when dig is unavailable. Its output is harder to parse than dig +short, so prefer dig for scripted assertions and keep nslookup for interactive debugging.

Key takeaways

  • nslookup resolves names and queries record types.
  • It is a fallback when dig is not installed.
  • dig +short is easier to parse for scripted checks.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →