Please consider (possibly @vgaetera as last page editor) to fix first command-line quote to this on the page DNSCrypt with Dnsmasq and dnscrypt-proxy2.
# Install package
opkg update
opkg install dnscrypt-proxy2
# Modify dnsmasq configuration
uci set dhcp.@dnsmasq[0].noresolv="1"
uci set dhcp.@dnsmasq[0].localuse="1"
uci -q delete dhcp.@dnsmasq[0].server
uci add_list dhcp.@dnsmasq[0].server="127.0.0.53#5353"
uci commit dhcp
# Enable DNS encryption
sed -i '/^listen_addresses/ s/:53/:5353/' /etc/dnscrypt-proxy2/*.toml
sed -i "32 s/.*/server_names = ['google', 'cloudflare']/" /etc/dnscrypt-proxy/*.toml
service dnsmasq restart
service dnscrypt-proxy restart
Reason...
dnsmasq in current stable release (23.05.2) does not work as advertised. dnsmasq listens all interfaces although configured not to listen for preventing a conflict with default dnscrypt-proxy2 configuration. Also OpenWrt defaults make dnsmasq to listen all interfaces.
# grep interface /var/etc/dnsmasq.conf.cfg01411c
interface=eth0
except-interface=lo
no-dhcp-interface=eth1
# netstat -ltunp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 1583/uhttpd
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1583/uhttpd
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 4823/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 691/dropbear
tcp 0 0 :::443 :::* LISTEN 1583/uhttpd
tcp 0 0 :::80 :::* LISTEN 1583/uhttpd
tcp 0 0 :::53 :::* LISTEN 4823/dnsmasq
tcp 0 0 :::22 :::* LISTEN 691/dropbear
udp 0 0 0.0.0.0:53 0.0.0.0:* 4823/dnsmasq
udp 0 0 :::53 :::* 4823/dnsmasq
udp 0 0 :::123 :::* 6869/ntpd
# logread -e dnscrypt
...
Sat Mar 9 21:05:53 2024 daemon.err dnscrypt-proxy[5058]: [2024-03-09 19:05:53] [FATAL] listen udp 127.0.0.1:53: bind: address already in use
Sat Mar 9 21:05:53 2024 daemon.info procd: Instance dnscrypt-proxy::instance1 s in a crash loop 6 crashes, 0 seconds since last crash
So dnscrypt-proxy must move away to another port. dnsmasq behaviour looks like a bug, but I may be missing something and is a subject to another topic elsewhere.