Custom DNS

Per default, the DNS settings get set automatically and there is no way to change them (v4.0.5.18). This guide shows you how to replace connman's DNS with dnsmasq and setting your own DNS config.

Stop connman from managing DNS

If you don't have any DNS configured in /etc/resolv.conf anymore, you can't resolv any domains on the internet. It's smart to install a replacement for connman's DNS in advance. Otherwise you can temporarily solve that by executing echo "9.9.9.9" | devel-su tee /etc/resolv.conf

You need to add the --nodnsproxy proxy flag to connmand. This can be done by runing devel-su systemctl edit connman and pasting this into there:

[Service]
RuntimeDirectory=connman

Afterwards run devel-su systemctl restart connman.

Use dnsmasq for DNS

As the name already implies, dnsmasq is not a full-fledged DNS server. If you want a real, recursive DNS resolver, consider using unbound instead.

Install dnsmasq

dnsmasq is available on SailfishOS chum. You 1st need to add the 3rd-party-repo, afterwards running devel-su pkcon refresh && pkcon install dnsmasq will install it.

Disable your current DNS handler

On a fresh installation, DNS is handled by connman. You can remove it with these instructions.

Permanently run dnsmasq on boot

Execute devel-su systemctl enable --now dnsmasq to enable it permanently & start it now.

Configure dnsmasq

dnsmasq's configuration lies under /etc/dnsmasq.conf. You can get more information about its config options from dnsmasq's manpage and ArchWiki.

Install & configure unbound DNS server

Unbound is a full-fledge recursive DNS resolver. You should consider to not fetch from the root servers but forward your requests to another Server via DoT.  Bind unbound to 127.0.0.1 to avoid access from outside.

More information can be found in ArchWiki.