Your IPv4 address:
Operating system:

How to use nslookup for DNS records and troubleshooting

When a site will not open or mail does not arrive, nslookup lets you ask a DNS server directly what it knows about a domain or an IP address. That separates a name-resolution problem from a fault in the website or mail service itself. Keep one thing in mind: the answer comes from the resolver you asked and may come from its cache, so it is not necessarily what the authoritative server says now.

The basic commands

Run nslookup example.com to ask the resolver configured on your computer for address records. To request a particular type from a particular server, add both: nslookup -type=MX example.com 1.1.1.1 asks the server at that address for the domain’s MX records. Replace the reserved example domain with your own, and choose a resolver that your network policy permits.

For a reverse lookup, give an IP address as the query. The tool then asks for a PTR record, if one exists. A PTR result is the name someone configured for that address. It does not independently verify who operates the host.

Which record type to ask for

A and AAAA records hold IPv4 and IPv6 addresses. MX records name the mail exchangers, NS records list the nameservers, and TXT records carry text used by several protocols. If a record of one type is missing, that does not mean the whole domain is missing.

Read the type as well as the value before you change website, email or security settings. A CNAME is an alias for another name and not an IP address. An answer can also contain more than one address, and the address offered may vary by resolver or location.

Timeouts, NXDOMAIN and stale answers

A timeout means the server you queried did not answer in time: it may be unreachable, blocked or slow. It does not prove that the domain has no records. NXDOMAIN means that this resolver reported the name as nonexistent, so check the spelling and any subdomain first.

An old value is usually a cached one. Resolvers may keep earlier records until their TTL expires, and after a DNS change different resolvers can return different results for a while.

Ask the authoritative server when two answers disagree

A single result can reflect one resolver’s cache. Run the lookup with the type set to NS to list the domain’s nameservers, then repeat your query with one of them as the server. Line up three things: what the authoritative server holds now, what the resolver used by the affected client returns, and the record you expected. Allow for TTL after changing a zone. The articles on DNS caching and DNS update delays explain why copies differ.

A correct DNS answer does not mean the service works

When a website fails, test the connection itself once the name resolves. A correct address record cannot guarantee that the web server or its TLS configuration works.

For mail, check the MX target name separately and confirm that it resolves to an address. Do not read the MX preference number as a performance score. Smaller values mean higher priority, and delivery still depends on the receiving mail server being available.