Open-source project maintainers often need to confirm that domain changes have propagated correctly. This article outlines how to use the nslookup command-line tool to check DNS records, interpret common errors, and adjust query settings for accurate verification.

Context: Maintainer verifying a new domain record

In this hypothetical situation, a maintainer of a small documentation project has just added two DNS records for a new domain and wants to confirm what public resolvers return. The maintainer keeps a plain text file named dns-check-notes.txt with one line per planned record, so each check can be compared against an intended value rather than memory.

The notes contain three entries. The first is the apex A record: host label left blank, intended address 192.0.2.44, and a comment reading “docs site primary.” The second is the www CNAME: host label www, intended target docs-v2.example-project.test, and a comment reading “points to the documentation host.” The third is a TXT record at the underscore-prefixed label _verify-docs, with the intended value “project-proof-2024,” used purely so the maintainer can tell one zone apart from another in query output.

For the first pass, the maintainer queries each name against two different public resolvers and writes the returned address or target on the same line as the expected value. A small mismatch is expected right after a change: the apex record may still show the old 192.0.2.40 address on one resolver while the other already returns 192.0.2.44. That difference is why two resolvers are used instead of one, and why the query is repeated later rather than treated as a single verdict. The CNAME result is compared as a name, not as an address, so an answer that resolves all the way to an IP is marked as “followed” and re-queried with recursion tracing in mind.

A second example covers the TXT record. Here the maintainer accepts a returned value wrapped in quotes as equivalent to the unquoted intended text, and records it exactly as printed so a later comparison does not mistake quoting for a changed value. For the choice between querying the authoritative nameserver directly or asking a public resolver, this maintainer picks the public resolver first, because the question at hand is what ordinary lookups currently see; the authoritative query is reserved for a follow-up if results disagree.

These are self-made examples for explaining the check, not records from a real project or results of a completed trial.

Running basic queries in non-interactive mode

For a one-off lookup, nslookup's non-interactive mode takes the name or IP address to look up as the first command-line argument and the DNS name server as the second. If the second argument is omitted, nslookup uses the default DNS name server, so each check can be run directly from a Windows command line or script. A resource record type is requested with the type option, for example returning only IPv6 records. Limitations such as timeouts or missing records are reported as error messages rather than returned values.1

You can take your existing dns-check-notes.txt and add a short “lookup form” column beside the intended value, so each record carries the exact non-interactive command you plan to run. For the apex example, that column might read “dig, name only, type A, against one chosen resolver” next to 192.0.2.44; for the TXT entry, “nslookup, type TXT, name only” beside the quoted text. You might keep shorter labels if the full wording feels heavy.

When you run each query once, write the answer next to the planned value rather than in a separate scratch file. If the output includes extra lines such as server information, you can copy only the answer line, then mark it “match,” “different,” or “no answer.” For the second resolver pass, add a second answer column instead of overwriting the first, which keeps the comparison visible.

You can choose how much detail suits your notes: some maintainers record only the returned address or target, others also note the resolver label they used. Either way works; the useful part is that the form stays the same for the apex and TXT entries, so you compare intended and returned values side by side without relying on memory.

Switching to interactive mode for flexible checks

For multiple lookups or several configuration changes, Microsoft's nslookup documentation describes an interactive mode. To enter it, type a hyphen as the first nslookup argument instead of a computer name, followed by a DNS name server name or IP address if one is wanted; entering nslookup alone and then a name or IP address also reaches the interactive prompt. That prompt appears as >.1

At the interactive prompt, the documentation says names or IP addresses, set variables, and other options can each be entered on separate lines. The set all command returns the current server's nslookup options and parameter settings, server 4.4.4.4 changes the default DNS name server, and set type=HINFO changes the query resource record type. Ctrl+B interrupts an interactive command at any time, and exit leaves interactive mode.1

You can take your existing dns-check-notes.txt and treat interactive nslookup sessions as a second pass, after the batch queries have given you a first picture. In interactive mode you can switch servers and re-query the same name without retyping the whole command, which helps when one resolver's answer needs a closer look. For the apex A record example, you might start with the primary resolver, then move to the secondary and ask for the same host; note which server produced the differing address so the entry stays readable later.

Interactive mode also lets you set a record type once and try several names in succession, so the TXT example can be checked alongside the apex entry in one sitting. Consider recording each response on the intended-value line, even when it matches, so a later reader can see that both forward and text records were examined. If an answer looks stale, you can query another resolver in the same session and compare; the choice of how many resolvers to try is yours.

One caution: the keyboard transcript is not a durable note. Before closing the session, copy the returned values into the notes file beside their intended values, and mark which entries came from the interactive pass rather than the batch run. These are author-made illustrations of a checking habit, not results from a real lookup.

Selecting specific resource record types

To verify specific resource record types, maintainers can use the set type command within an interactive nslookup session. This command changes the query type for subsequent lookups, allowing checks beyond the default A record. For example, setting the type to MX queries mail exchange records, while TXT retrieves text information. Other supported types include CNAME for aliases, NS for name servers, and SOA for start of authority details. The command syntax is straightforward: enter set type followed by an equals sign and the desired resource record identifier. This approach enables focused verification of individual DNS components, ensuring that specific records like those added for a new domain resolve correctly according to their intended function.2

You can take your dns-check-notes.txt and add a short “record type” label to each line, so the note names which kind of answer you expect before you look at any output. For the apex example, you might write “A” beside the intended address 192.0.2.44, and for the text entry write “TXT” beside the unquoted phrase. When a query returns something, you can ask yourself whether the shape of the answer matches the label you wrote: an address for A, a quoted string for TXT.

This small labeling step also helps you decide what to query. If a note line says “A,” you can choose to look only at address answers and set other output aside for now. If it says “TXT,” you can compare the returned text with your intended wording, treating quotes as wrapping rather than content. You might prefer to add a second label for cases where you expect more than one answer, then note on the same line how many values you saw.

For records added later, you can keep the same two fields—type and intended value—and leave the returned column empty until you plan the next check. You decide whether to group lines by type or keep them in the order you added them; either way, the label makes it easier to spot a mismatch between what you meant to publish and what a resolver hands back.

Interpreting common nslookup error messages

If a lookup request fails, the nslookup documentation says the tool returns one of several error messages. “timed out” means the server did not respond after a set time and a set number of retries; the timeout period is set with nslookup set timeout and the retry count with nslookup set retry. “Server unresponsive” means no DNS name server is running on the server computer. “No records” means the name server has no resource record of the type being queried, even though the computer name is valid; the query type is set with nslookup set querytype. “Nonexistent domain” means the computer or DNS domain name does not exist.1

You can take your dns-check-notes.txt and add two short lines at the bottom for error wording you expect to see: one for a name that should not resolve, and one for a record type that should be absent. For example, a line might read “nonexistent subdomain — expect server can't find,” and another “old TXT value — expect no answer text.” You can choose whether to write the exact phrase your local resolver prints or a shorter paraphrase; either works as long as you recognize it later.

When a query returns an error you did not anticipate, consider copying the message into the notes beside the intended value and marking it “unexplained” rather than guessing at a cause. This keeps the guesswork separate from the planned record, so a later pass can tell whether the error changed.

These error lines are your own preparation, not verified resolver behavior, and the particular wording a tool prints may differ from what you wrote down. You might keep both the written expectation and the actual message side by side, then decide which one to trust for the next comparison.

Adjusting timeout and retry settings

Within an nslookup session, the documented set command changes configuration values that affect how lookups behave. The timeout setting, written as set timeout, changes the initial number of seconds to wait for a lookup request reply; the retry setting, set retry, sets the number of retries. The source lists these among the parameters of the set command, so they are configuration changes made through that command rather than results of a query.3

You can take your existing dns-check-notes.txt and add a timeout intention and a retry intention to the header, written as a plan rather than a setting: for example, “allow about five seconds per query; try twice before deciding.” When a lookup returns nothing within your stated patience, you might record “no answer on first try” beside the intended value, leave the returned column empty for now, and note when you plan the second attempt. The example is a writing choice, not a tested configuration.

Consider one entry where a timeout and a genuine mismatch should be told apart. In dns-check-notes.txt, the apex A line with intended value 192.0.2.44 can carry “timeout, retry planned” if no answer arrives, while a returned 192.0.2.45 would be written as an answered but different value. You can decide which of those two notes would prompt you to look again at your own planned value, and say so in the comment field.

You might also prepare a short line for a retry that still yields no answer, such as “two attempts, no reply, choose next step later.” This keeps the note honest about what you intend to do rather than implying a result. You can keep these lines for both the apex entry and the TXT entry, adjusting the wording to which record you were checking.

Frequently asked questions

How can I add a lookup form column beside the intended values in my dns-check-notes.txt?

You can take your existing dns-check-notes.txt and add a short “lookup form” column beside the intended value, so each record carries the exact non-interactive command you plan to run. For the apex example, that column might read “dig, name only, type A, against one chosen resolver” next to 192.0.2.44; for the TXT entry, “nslookup, type TXT, name only” beside the quoted text.

When I run each query once, where should I write the answer relative to the planned value?

When you run each query once, write the answer next to the planned value rather than in a separate scratch file. If the output includes extra lines such as server information, you can copy only the answer line, then mark it “match,” “different,” or “no answer.”

For records I add later, how can I keep the type and intended value fields while leaving the returned column empty until the next check?

For records added later, you can keep the same two fields—type and intended value—and leave the returned column empty until you plan the next check.