This is exactly how my DNS Servers, on production, are set:
/ip dns
set allow-remote-requests=yes cache-max-ttl=30m cache-size=81920KiB max-concurrent-queries=1000 \
max-concurrent-tcp-sessions=40 servers=1.1.1.1,8.8.8.8
With that settings, actually only 40892 KiB of memory is occupied.
Default values:
/ip dns
set allow-remote-requests=no cache-max-ttl=1w cache-size=2048KiB \
max-concurrent-queries=100 max-concurrent-tcp-sessions=20 \
max-udp-packet-size=4096 query-server-timeout=2s query-total-timeout=10s \
servers="" use-doh-server="" verify-doh-cert=no
What I have changed and why:
allow-remote-requests=yes obviously for activate the service
cache-max-ttl=30m (from 1w to 30m) do not want too old DNS records...
cache-size=81920KiB (from 2MiB to 80MiB) the RB1100Dx4 have 1GB of ram...
max-concurrent-queries=1000 (from 100 to 1000) for 4000 users are sufficient.
max-concurrent-tcp-sessions=40 (from 20 to 40) TCP is rarely used, 40 for 4000 users are sufficient.
servers=1.1.1.1,8.8.8.8 for specify what servers must be used.
And obviously on Border Firewall, on another machine, no one on Internet can reach the DNS service on that machine...