Triggering DNS updates when WAN link fails or recovers

Hello,

I’ve read this [1] document and found it very interesting.
Though, I still have a remaining question:
which is the simplest way to trigger a DynDNS update script whenever a WAN link status changes (either becomes up or down) ?

Having updated DNS records would help to keep connections coming in when peers use DNS A records.

[1] https://wiki.mikrotik.com/wiki/Advanced_Routing_Failover_without_Scripting

Best regards

Write a script which will compare your IP of dns record (dynamic address in address list) with address of your interface. If they’re differs, run a ddns script. This advanced routing with routing marks too crowded.

Hi

some options:

edit: added links