Friday, 22 January 2016

Script: Clear DNS Cache and Restart the DNS Cache and DNS Services

Here’s a simple CMD (Command Line) script for clearing the DNS Cache and restarting both the service and the DNS service:

DnsCMD SERVERNAME /ClearCache
Net Stop DNSCache && Net Start DNSCache
Net Stop DNS && Net Start DNS
DnsCMD SERVERNAME /ClearCache
Pause

The above script was set up to be run both on a scheduled task and manually on an older SBS 2011 Essentials VM as it seems to have DNS lookup problems.

This script solves the problem.

This server is slated to be refreshed soon.

Philip Elder
Microsoft High Availability MVP
MPECS Inc.
Co-Author: SBS 2008 Blueprint Book

No comments:

Post a Comment

NOTE: All comments are moderated.