Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am just curious if you could use dig to check if a certain nameserver responds to recursive queries.


share|improve this question
up vote 13 down vote accepted

Use dig and check the status of the RD and RA bits in the response.

By default dig will send a recursive query (RD set in the query header) unless you set the +norecurse command line flag.

If the server supports recursive queries the response will have the "recursion available" RA bit set in the response headers.

The RA bit is the diagnostic test for recursive query support.

share|improve this answer

See if you can query it for a DNS entry for which it is not authoritative, e.g., try: host, where is the name server you're testing. If it doesn't respond to recursive queries, you will get a REFUSED.

$ host
Using domain server:

Host not found: 5(REFUSED)

whereas a DNS server that does recursive queries:

$ host
Using domain server:
Aliases: has address has address has address has address
share|improve this answer
Thanks a lot @cjc. I also figured out another method but using dig. Try to lookup a domain to a nameserver that is non-authorative to the domain. If it doesn't return anything, then it's not responding to recursive queries. – Mikko Mar 20 '12 at 23:28
@Mikko, yes, both dig and host (and the now deprecated nslookup) are DNS query tools. All of them are sufficient for determining whether a DNS server is allowing recursive queries from your IP address. – cjc Mar 21 '12 at 0:42
this is wrong - REFUSED is also the response code you get if you ask an authoritative name server for information about a domain for which it doesn't have a zone file. – Alnitak Nov 7 '13 at 20:41

Another option, use an online checker such as:

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.