nslookup

The nslookup (Name Server Lookup) command allows to query DNS servers to retrieve information about domain names, such as IP addresses.

nslookup DOMAIN_NAME
nslookup OPTIONS DOMAIN_NAME SERVER
  • OPTIONS: Specifies the type of DNS record querying (e.g., A for IPv4, AAAA for IPv6).

  • DOMAIN_NAME: The domain name to look up.

  • SERVER: The DNS server to query (optional). Common DNS servers include:

    • Cloudflare: 1.1.1.1, 1.0.0.1

    • Google: 8.8.8.8, 8.8.4.4

    • Quad9: 9.9.9.9, 149.112.112.112

# This command queries Google’s DNS server (8.8.8.8) for the IPv4 address (A record) of example.com.

nslookup -type=A example.com 8.8.8.8
nslookup -type=MX example.com 8.8.8.8

Last updated