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
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 whatever.com [/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.
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:
dnsmgmt.msc
)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 my.zone.domain.tld
For active directory integrated zones, reload the zone data from AD:
dnscmd dns1.domain.tld /zonereload my.zone.domain.tld
assuming that the fqdn of your dns server is dns1.domain.tld.
and my.zone.domain.tld.
is the fqdn of the zone