Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Wednesday, October 2, 2013 7:40 PM
HI
I am running on windows 2008 R2 ADDNS.
I need script to clear cache from DNS server once in a day. Please suggest..
All replies (3)
Thursday, October 3, 2013 12:59 PM ✅Answered | 1 vote
I see. The command I provided will do the trick. Here is the DNSCMD command syntax that you can put into a batch file, and run remotely using PSEXEC from your own desktop.
psexec \DNS-Server-01 dnscmd /clearcache
psexec \DNS-Server-02 dnscmd /clearcache
psexec \DNS-Server-03 dnscmd /clearcache
etc ...
DNSCMD:
http://technet.microsoft.com/en-us/library/cc772069.aspx
PsExec v1.98
http://technet.microsoft.com/en-us/library/cc772069.aspx
-
You can also use copy that command into notepad, save it as a bat file (such as clearcache.bat), then copy it to all DNS servers, then create a scheduled task on each server to run it on a schedule of your choosing. You can also get creative and just place it on your own machine, create a scheduled task using PSEXEC to run it remotely on all DNS servers.
Schedule a Task:
http://technet.microsoft.com/en-us/library/cc748993.aspx
Ace Fekay
MVP, MCT, MCITP/EA, MCTS Windows 2008/R2 & Exchange 2007, Exchange 2010 EA, MCSE & MCSA 2003/2000, MCSA Messaging 2003
Microsoft Certified Trainer
Microsoft MVP - Directory Services
Technical Blogs & Videos: http://www.delawarecountycomputerconsulting.com/
This post is provided AS-IS with no warranties or guarantees and confers no rights.
Thursday, October 3, 2013 2:12 AM | 1 vote
You can use dnscmd** /**clearcache.
Curious, why do you need to clear the cache? I have customers that have DNS running for the past 6 months without requiring to clear the cache. Are you seeing errors or having a problem? If yes, please elaborate and we'll try to assist you.
Ace Fekay
MVP, MCT, MCITP/EA, MCTS Windows 2008/R2 & Exchange 2007, Exchange 2010 EA, MCSE & MCSA 2003/2000, MCSA Messaging 2003
Microsoft Certified Trainer
Microsoft MVP - Directory Services
Technical Blogs & Videos: http://www.delawarecountycomputerconsulting.com/
This post is provided AS-IS with no warranties or guarantees and confers no rights.
Thursday, October 3, 2013 9:41 AM
Required a script that will clear the DNS cache on all domain controllers once or twice a day.
Last month, the NYtimes.com site was hacked and name servers were taken over and redirected to a unknown group.
The normal cache clearing didn’t happen because the name servers were taken over and set themselves as authoritative. Windows DNS normally clears non-authoritative names every 24 hours.