DNS
is a resolved.conf
only setting. systemd docs are comprehensive and help navigating what to put where, no need to throw shit at the wall and see what sticks. :)
man resolved.conf:
OPTIONS
The following options are available in the [Resolve] section:
DNS=
A space-separated list of IPv4 and IPv6 addresses to use as system DNS servers. Each address can optionally
take a port number separated with ":", a network interface name or index separated with "%", and a Server
Name Indication (SNI) separated with "#". When IPv6 address is specified with a port number, then the
address must be in the square brackets. That is, the acceptable full formats are
"111.222.333.444:9953%ifname#example.com" for IPv4 and "[1111:2222::3333]:9953%ifname#example.com" for IPv6.
DNS requests are sent to one of the listed DNS servers in parallel to suitable per-link DNS servers acquired
from systemd-networkd.service(8) or set at runtime by external applications. For compatibility reasons, if
this setting is not specified, the DNS servers listed in /etc/resolv.conf are used instead, if that file
exists and any servers are configured in it. This setting defaults to the empty list.
Added in version 213.
TL;DR: Create a drop-in for resolved and put the DNS= line there, with colon separating the port. Reload the config of the service to activate.
install -o0 -g0 -dm755 /etc/systemd/resolved.conf.d
install -o0 -g0 -m644 <(cat <<EOF
[Resolve]
DNS=127.0.0.1:9053
EOF
) /etc/systemd/resolved.conf.d/90-dns_port.conf
cat /etc/systemd/resolved.conf.d/90-dns_port.conf
[Resolve]
DNS=127.0.0.1:9053
systemctl reload systemd-resolved