You need to set up stubby or dns-http-proxy and change configuration to use backends of your service, then force dnsmasq to use respective port of proxy on localhost as forwarder.
If your goal is adblocking then the Adblock package works well.
But settings up HTTPS-DNS-Proxy and then using a DNS server from libredns which does the adblocking for you is not much of a deal to setup.
I use both Adblock for adblocking and HTTPS-DNS-Proxy for secure DNS, not for adblocking but just for plain DNS albeit secure because the DNS is encrypted
@frollic@egc Thanks for your answers, I found how to do it)) when they write that it is not difficult, I do not always understand what it means without commands.
Yes, I also wanted to block ads, but adblock is a manual mode, I tried, ads still go through, it blocks some things and not others.
Perhaps a good solution for encryption (DNS protection) and ad blocking would be dnscrypt-proxy
opkg update
opkg install https-dns-proxy
while uci -q delete https-dns-proxy.@https-dns-proxy[0]; do :; done
uci set https-dns-proxy.dns="https-dns-proxy"
uci set https-dns-proxy.dns.resolver_url="https://doh.libredns.gr/dns-query"
uci set https-dns-proxy.dns.listen_addr="127.0.0.1"
uci set https-dns-proxy.dns.listen_port="5053"
uci set https-dns-proxy.dns.user="nobody"
uci set https-dns-proxy.dns.group="nogroup"
uci commit https-dns-proxy
/etc/init.d/https-dns-proxy restart