Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

in bind9 I can use rndc flushname zone.tld from a shell.

In the Windows DNS mmc I can select the zone and delete it.

With dnscmd I can flush the whole cache, but I just need to flush a zone's cache every now and then.

Is it possible and how? TIA

share|improve this question
up vote 3 down vote accepted

DNSCmd.exe is used to display and change the properties of DNS servers, zones, and resource records. You can find detailed syntax here. As much as I would like to give proper reference and explanation for this, I found it by random googling, trial and error: cached lookups seem to be internally stored in Zone called ..Cache, and each cached zone is only a node under "..Cache", so the right switch to use is /NodeDelete:

dnscmd dnsserver.local /NodeDelete ..Cache [/Tree] [/f]

 /tree    Specifies to delete all of the child records.
 /f       Executes the command without asking for confirmation.

Still, it would be cool if anyone could find "..cache" in MS official documentation.

share|improve this answer
A bit more explanation would make this a better answer. – Dave M Apr 25 '13 at 16:35
There really isn't much to tell. /NodeDelete is well documented, and "..Cache" is ZoneName for all cached lookups. – Dusan Bajic Apr 25 '13 at 16:38
Answers that consist of a blind command are not really "good" answers. The standard on Server Fault is that an answer should explain both the "How" and the "Why". That includes providing a few words summarizing the "well documented" flags. – voretaq7 Apr 25 '13 at 17:47
OK, point taken. – Dusan Bajic Apr 25 '13 at 20:24
Awesome! It works perfectly. Thanks for figuring this out. – natxo asenjo Apr 26 '13 at 21:11

I'm afraid that programatically, you'll have to resort to /clearcache.

dnscmd doesn't have that functionality builtin, and there's nothing obvious in the API spec that suggest such a operation is exposed

You can do it from the GUI, though I doubt that's any help
To view and remove cached entries from a Windows DNS Server:

  1. Open the DNS Management Console (dnsmgmt.msc)
  2. Go to the View menu, and select Advanced
  3. Expand your DNS Server entry in the left pane
  4. Expand Cached Lookups
  5. To remove a cached record or an entire zone, simply right-click and choose "Delete"

For authoritative Servers, you can either refresh or reload zone data, depending on the source type.
For secondary name servers to refresh zone data from the master server:

dnscmd dns1.domain.tld /zonerefresh

For active directory integrated zones, reload the zone data from AD:

dnscmd dns1.domain.tld /zonereload

assuming that the fqdn of your dns server is dns1.domain.tld. and is the fqdn of the zone

share|improve this answer
Thanks for your answer. I am afraid my question regarded a caching DNS server, not an authoratitive one. I have edited the title of the question to reflect this. – natxo asenjo Apr 25 '13 at 8:02
by the way, I had already indicated that I could do it from the mmc but thanks anyway – natxo asenjo Apr 25 '13 at 11:41

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.