Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to issue a query to a specific DNS server, whose IP address I know. It doesn't really matter if it's on Windows or *nix.

In Windows I can do something like:

C:\Documents and Settings\Anton Daneyko>nslookup
Server:  DNSs2.Uni-Marburg.DE

Non-authoritative answer:

But his uses the system wide DNS settings. Instead, I would like to query a specific DNS server, to test if it is responding to my queries correctly or responding at all.

So it should be something like:

nslookup --dns-ip=
share|improve this question

4 Answers 4

up vote 50 down vote accepted

For basic A and CNAME records, you can simply do

nslookup some.dns.server

   nslookup [-opt ...]             # interactive mode using default server
   nslookup [-opt ...] - server    # interactive mode using 'server'
   nslookup [-opt ...] host        # just look up 'host' using default server
   nslookup [-opt ...] host server # just look up 'host' using 'server'

or if you just type nslookup without any parameters, you can do a lot more options...

Commands:   (identifiers are shown in uppercase, [] means optional)
NAME            - print info about the host/domain NAME using default server
NAME1 NAME2     - as above, but use NAME2 as server
help or ?       - print info on common commands
set OPTION      - set an option
    all                 - print options, current server and host
    [no]debug           - print debugging information
    [no]d2              - print exhaustive debugging information
    [no]defname         - append domain name to each query
    [no]recurse         - ask for recursive answer to query
    [no]search          - use domain search list
    [no]vc              - always use a virtual circuit
    domain=NAME         - set default domain name to NAME
    srchlist=N1[/N2/.../N6] - set domain to N1 and search list to N1,N2, etc.
    root=NAME           - set root server to NAME
    retry=X             - set number of retries to X
    timeout=X           - set initial time-out interval to X seconds
    type=X              - set query type (ex. A,AAAA,A+AAAA,ANY,CNAME,MX,NS,PTR,SOA,SRV)
    querytype=X         - same as type
    class=X             - set query class (ex. IN (Internet), ANY)
    [no]msxfr           - use MS fast zone transfer
    ixfrver=X           - current version to use in IXFR transfer request
server NAME     - set default server to NAME, using current default server
lserver NAME    - set default server to NAME, using initial server
root            - set current default server to the root
ls [opt] DOMAIN [> FILE] - list addresses in DOMAIN (optional: output to FILE)
    -a          -  list canonical names and aliases
    -d          -  list all records
    -t TYPE     -  list records of the given RFC record type (ex. A,CNAME,MX,NS,PTR etc.)
view FILE           - sort an 'ls' output file and view it with pg
exit            - exit the program
share|improve this answer
It's unfortunate that the manual uses the terms 'host' and 'server' rather than something clearer like 'domain-name' and 'dns-server'. – ClearCrescendo Jul 14 '14 at 6:33
It's not entirely incorrect. The "domain-name" is only part of a hostname. You can indeed do lookups on just the "host" portion of the FQDN, omitting the domain suffix. NSLOOKUP will automatically attempt to use any search-suffixes configured in your system to obtain a match. – TheCompWiz Jul 15 '14 at 18:40

Just digging into the options of nslookup, which you can display if you invoke nslookup and then typing help inside of the nslookup interactive mode gave me the right answer:

C:\Documents and Settings\Anton Daneyko>nslookup help
Server:  DNSs2.Uni-Marburg.DE

*** DNSs2.Uni-Marburg.DE can't find help: Non-existent domain

C:\Documents and Settings\Anton Daneyko>nslookup
Default Server:  DNSs2.Uni-Marburg.DE

Server:  []

Non-authoritative answer:
share|improve this answer

you can configure the primary DNS to be used with your connection.
Go to your connection properties => Internet Procol (TCP/IP). (the place where you can set a static IP)
Here you can manually define which DNS you want to use for each connection.
After testing, you can always change it back to it's previous value.

share|improve this answer
I don't think that is a "direct" way of querying a DNS server. – lepe Jul 17 at 7:07

Yes, C:\Documents and Settings\Anton Daneyko>nslookup will look up your own DNS server to find out the IP address for If you add the ip address or the name of a different DNS server to the command line, it will lookup that given DNS server for the ip address of Ex:

C:\Documents and Settings\Anton Daneyko>nslookup

Non-authoritative answer:

By the way, is the ip address of Google DNS servers.

But, both of the above give "Non-authoritative answers", as neither of them SOA, which is the authoritative for domain. Both have a cached copy that has been propagated from the SOA. If you want to ask the authoritative server, first find out the name of ip address of the authoritative server, using the command:

C:\Documents and Settings\Anton Daneyko>nslookup -type=ns
Server:  DNSs2.Uni-Marburg.DE

Non-authoritative answer:   nameserver =   nameserver =  internet address =  AAAA IPv6 address = 2400:cb00:2049:1::adf5:3b04  AAAA IPv6 address = 2400:cb00:2049:1::adf5:3a35  internet address =

This will return a non-authoritative answer from your local DNS server, from the Marburg Uni, naming all the authoritative servers for the Then you can use the command we used earlier to ask any of the 4 authoritative servers, as follows:

C:\Documents and Settings\Anton Daneyko>nslookup


As you see, this time the authoritative SOA server returned the ip addresses, hence you don't see the comment "Non-authoritative answer" comment, anymore. This is particularly useful, when you have created a new domain name or changed the hosting providers or transferred to a different domain registrar, and you can't access your website, as the new IP addresses haven't propagated even after 24 hours. Then you can start with the SOA and verify that your correct ip address is given by the DNS server, and then follow it further down the tree. Good to check if Google DNS servers have received the changes, and then lastly if your local DNS server can resolve your Domain name to correct IP address.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.