How to change dns on mobile network

Connman also respects /etc/resolv.conf if it’s a regular file.

So you can compile your regular resolv.conf:

rm /etc/resolv.conf
cat <<EOF >/etc/resolv.conf
nameserver <IP1>
nameserver <IP2>
namserver <IP3>
EOF

systemctl restart connman

This does not interfere with hotspot functionality though the namservers do not appear to be forwarded to the connecting machine. I wasn’t able to test for when the phone connects to wifi, but I see no reason why it shouldn’t work because nothing is interface-specific here.

PS: systemd-networkd is not active on SFOS and not required here; it was just a comparison

PPS: I wonder if this can be done in a way that one can still benefit from ConnMan’s DNS caching.