dt.iki.fi

Use custom DNS provider on Sailfish OS

Sailfish OS uses ConnMan.

By default it gets DNS providers from network providers, then acts as a DNS proxy for itself (this is good for caching queries).

If /etc/resolv.conf is not a symlink to this volatile file, but a regular file instead, ConnMan respects it.1

Therefore - after choosing some suitable DNS servers - one can do the following:

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

systemctl restart connman

Both IPv4 and IPv6 formats are valid here, without any additional formatting.

Test if it works with dig or nslookup (install bind-utils) or a site like dnscheck.tools


  1. I suspect DNS caching won’t work anymore then. I’ll look into it and hopefully there’s a way.