2 wan fail over with detection further than gw

All the tutorials I keep finding appear to ping only the gateway device (cable modem) for detecting the need to fail over. I want to know how can I make it fail over if say google dns doesn’t respond? or quad 1 or quad 9 dns doesn’t respond? Anyone able to point me in the direction of the proper tutorial for that?

I have a fiber connection and a coax cable internet connection going to a mikrotik I want to do fail over on. I don’t care about the load balancing portion of that.

Thanks.

How many public DNS servers will it take to satisfy you LOL

https://wiki.mikrotik.com/wiki/Advanced_Routing_Failover_without_Scripting

By the way I have the exact same setup. fibreop is my main conneciton and cable is my backup.
In my case I also have emails which are attached to the cable connection.
Here is my setup using google and opendns servers…

/ip route
add check-gateway=ping distance=2 gateway=8.8.4.4 target-scope=30
add check-gateway=ping distance=3 gateway=208.67.220.220 target-scope=30
add distance=10 gateway=isp2gateway target-scope=30
add distance=2 dst-address=8.8.4.4/32 gateway=isp1gateway
add distance=3 dst-address=208.67.220.220/32 gateway=is1pgateway
add comment=Email_bypass distance=1** dst-address=24.222.0.20/32 gateway=
isp2gateway**

The last rule basically states (shortest distance so any matches will follow this routing) if the destination address is my ISP backup’s email server then use this route. Since SMTP resolves to that address, good to go!

The backup ISP route is there in the case that attempts at google and opendns on the primary fail…
The router keeps checking these primary routes and if they come back up then the router will switch back to them.