How do I configure more DoH servers?

Using RouterOS as the DNS server for LAN network devices.

I have my own DoH server, but its network connection is unstable. Therefore, I want RouterOS to automatically switch to a public DoH server when my own DoH server becomes unreachable.However, RouterOS only supports one DoH server at a time.
How can I configure this?
At this time, can I only switch DoH servers by using a script on RouterOS?

ROS Version: 7.23 CHR

Use the DNS forwarder. There is a topic describing how this can be done.

As @erlinden mentioned, there was this thread from last week: Problems with DoH, set standard DNS as fallback? - RouterOS / General - MikroTik community forum.

However, like I also wrote in that thread, the workaround does not allow you to prioritize one DoH as main, and others as failover. All DoH providers will be used and the queries are distributed among them. It does handle one of multiple DoH servers becoming unreachable. But you cannot tell RouterOS to only use your own DoH server and only fallback to Cloudflare when your server is down for example. If you want that, you'll need to use Netwatch with HTTPS probe and scripting.

Are you sure?

The document clearly states: 'Configured forwarder servers will be used by round-robin algorithm - for each query, next server will be used to resolve DNS name.'

Okay, it looks like I can only use a script.
thanks

I think that multiple requests are done and that the response of the DoH server who answers first is used. So perhaps no need to use some sort of script.

I currently run into the problem that Adlist is no longer functional (probably all requests are forwarded if they can't be found in the DNS cache).

Do you have more than one Mtik device in your network? If yes, you can run separate DoH on each of them and provide its IPs to the clients via DHCP. I assume that clients can switch to the available one automatically.

In my home network I have three separate DNS instances (two of them are DoH, one use DNS provided by ISP) assigned to the different VLAN, and it's work perfectly.