Tool to detect and alert when DNS failover occurs

canuckconsulting
canuckconsulting used Ask the Experts™
on
We have a Windows 2012 IIS server which we think is losing connection to its primary DNS and failling over to its alternate.   We would like to receive an email notification when this occurs.  How can this be achieved?

If possible it would be useful for the alert to include any details which might help us investigate what is preventing it contacting the primary DNS.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2015

Commented:
Go in Event Viewer.

Find DNS client and then enable logging.

Then in Actions Bar click on Attach a Task To this log ....

Author

Commented:
Thanks!  Is there a way to include the error in the email?  This would be handy if I initially have all logged errors sent to me.
Top Expert 2015
Commented:
Yes shure.

https://blogs.technet.microsoft.com/jhoward/2010/06/16/getting-event-log-contents-by-email-on-an-event-log-trigger/

It is posible with powershell to.

Just schedule:

$dns = Get-WinEvent -LogName Microsoft-Windows-DNS-Client/Operational
Send-MailMessage -To "mail@mail.com" -From "mail@mail.com" -Subject "DNS" -Body $dns

Author

Commented:
Cheers for the help!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial