I am using Mikrotik as DNS server and main router. I have two DNS records, say x.x.x.1 and x.x.x.2 for mail server mail.example.com and trying to find solution when first server is down and Mikrotik can automatically route it to second server. Could you help me with that.
Asked
Active
Viewed 528 times
1 Answers
3
You can use netwatch function: watch x.x.x.1, and when it's down, modify your DNS static record to x.x.x.2. Use very small TTL values, like 1 minute.
/tool netwatch
add host=8.8.8.8
down-script="/ip dns static set [ find name=mail.xx.com ] address=x.x.x.2 ttl=30s "
up-script="/ip dns static set [ find name=mail.xx.com ] address=x.x.x.1 ttl=30s "

Benoit PHILIPPON
- 500
- 3
- 9