How to prefer a subnet over other in multi result dns answers?

some website give multi dns answer for a host.
how can I prefer a subnet in dns answer over others?

for example many websites hosted on cloudflare have
104.20.0.0 and 172.67.0.0 subnets in their answer but in my country the 104.20 has issues and 172 doesnt.

something like sortlist in resolve.conf but for openwrt?

I am not sure if dnsmasq can do such filtering. In case you find something like that you can apply it in /etc/dnsmasq.conf .