answered
2015-04-11 04:35:32 +0200
3th of May 2020: Updated to work regardless of connman version installed and tested on Jolla C running SFOS 3.3.0.16.
This is just a work-around to set custom nameservers (DNS) for a desired network interface. It'll be permanent and work across reboots. Use at your own risk and be sure to have charged your Jolla phone before setting this up. In my case <10% battery life was used.
Here's how to configure custom nameservers for a particular network interface. You need to have dev mode enabled and 30 minutes available (to be safe) for your Jolla phone to compile some stuff. It's recommended to SSH to your Jolla phone from a computer for easier management.
1. Get source and build connman to get the missing connmanctl.
devel-su
pkcon install gcc gcc-c++ make automake autoconf libtool glib2-devel dbus-devel iptables-devel gnutls-devel readline-devel
cd /home/nemo/Downloads
CONNMAN_VER=$(connmand -v|cut -d'+' -f1)
curl -O https://git.kernel.org/pub/scm/network/connman/connman.git/snapshot/connman-${CONNMAN_VER}.tar.gz
tar xf connman-${CONNMAN_VER}.tar.gz
cd connman-${CONNMAN_VER}
./bootstrap
./configure
make
cp client/connmanctl /usr/local/bin/
2. Remove dependencies and files not needed after build (still as root)
pkcon remove kernel-headers glibc-headers binutils gcc gcc-c++ make automake autoconf glibc-devel pcre-devel glib2-devel gnutls-devel libgcrypt-devel libgpg-error-devel libtasn1-devel zlib-devel ncurses-devel readline-devel iptables-devel dbus-devel
rm -rf /home/nemo/Downloads/connman-*
3. Configure a network interface to use specific nameservers (DNS) (Still as root)
List available networks
[root@jolla-hostname ~]# connmanctl services
*ssid_name wifi_[NUMBERS]_managed_psk
* provider_name cellular_[NUMBERS]_context1
Configure name servers for your desired network interface. Replace 8.8.x.x with whatever you like.
[root@jolla-hostname ~]# connmanctl config cellular_[NUMBERS]_context1 --nameservers 8.8.8.8 8.8.4.4
If you're currently connected to the edited network, disconnect and connect to it again for the changes to take effect.
Additional options:
See currently custom configured nameservers (output empty if none set)
[root@jolla-hostname ~]# grep "Nameservers" /var/lib/connman/cellular_[NUMBERS]_context1/setttings
Unset custom nameserver settings
connmanctl config cellular_[NUMBERS]_context1 --nameservers
Uninstall custom compiled connmanctl:
rm /usr/local/bin/connmanctl
My mobile carrier's DNS is particularly slow so being able to use another DNS provider would be useful.
aegis ( 2014-01-21 10:51:07 +0200 )editIt is unethical not to return a correct response to a DNS request and hijack the users browser. Richard
richardski ( 2014-01-21 11:09:09 +0200 )edit@richardski I agree, but how can i fight that vs a big telecom corporation? :( And, by the way, many landline ISPs (ADSL/fiber) are implementing this, offering their own alternative DNS servers to opt out. ISPs get revenue because of that and inexperienced users see this as "service".
c.la ( 2014-01-21 12:17:17 +0200 )edit