Take the 2-minute tour ×
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 superuser.com
Server:  DNSs2.Uni-Marburg.DE

Non-authoritative answer:
Name:    superuser.com

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= superuser.com
share|improve this question

3 Answers 3

up vote 41 down vote accepted

For basic A and CNAME records, you can simply do

nslookup somewhere.com 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

> stackoverflow.com
Server:  []

Non-authoritative answer:
Name:    stackoverflow.com
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

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.