Created
February 25, 2026 07:39
-
-
Save ColCh/7fa03a5e93db67e8550bd2db6d1d678b to your computer and use it in GitHub Desktop.
mikrotik dns failover
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /system/script | |
| add comment="on dnsdist is down" dont-require-permissions=yes name=on-dnsdist-down \ | |
| policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source="# Replace the entire upstr\ | |
| eam list (comma-separated, no spaces)\ | |
| \n/ip/dns/set servers=1.1.1.1,1.0.0.1,2606:4700:4700::1111,2606:4700:4700::1001\ | |
| \n\ | |
| \n/tool fetch url=\"https://api.telegram.org/bot_REDACTED/sendMessage\ | |
| \\\?chat_id=REDACTED&text=dnsdist is down! \" keep-result=no\ | |
| \n\ | |
| \n" | |
| add comment="on dnsdist is up" dont-require-permissions=yes name=on-dnsdist-up policy=\ | |
| ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source="# Replace the entire upstream lis\ | |
| t (comma-separated, no spaces)\ | |
| \n/ip/dns/set servers=10.20.0.2\ | |
| \n\ | |
| \n/tool fetch url=\"https://api.telegram.org/bot_REDACTED/sendMessage\ | |
| \\\?chat_id=REDACTED&text=dnsdist is up \" keep-result=no\ | |
| \n\ | |
| \n" | |
| /tool netwatch | |
| add comment=dnsdist disabled=no down-script="/system/script/run on-dnsdist-down" host=10.20.0.2 test-script="" type=icmp up-script="/system/script/run on-dnsdist-up" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment