You are not logged in.

#1 2014-01-19 12:48:25

el mariachi
Member
Registered: 2007-11-30
Posts: 595

adblocking with /etc/hosts and connman

I'm using the hostsblock package to create a custom hosts file.
Everything works fine with netctl+dnsmasq, but it doesn't with connman.

It seems connman redirects all traffic to itself by writing "nameserver 127.0.0.1" in /etc/resolv.conf

I can't ping anything. Even with a vanilla hosts file. Adding some other nameserver like "8.8.8.8" fixes the name resolving, but doesn't block ads. Dnsmasq is not working at the same time as connman.
Connman has a builtin dns caching server, but I can't find any documentation on how it works/how can it be configured.
Ideas?

Configuring my service profile with both nameservers fixed it. Isn't there a way to set a global nameserver?

Last edited by el mariachi (2014-01-19 13:55:58)

Offline

#2 2014-01-19 13:58:11

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: adblocking with /etc/hosts and connman

Adblocking is more appropriately done by e.g. privoxy, than at the DNS level.

Offline

#3 2014-01-19 14:38:20

el mariachi
Member
Registered: 2007-11-30
Posts: 595

Re: adblocking with /etc/hosts and connman

what about global nameservers? having to configure that everytime I connect to a new network seems too much work. Maybe it's a planned feature?

Offline

#4 2014-01-19 15:01:18

ajbibb
Member
Registered: 2012-02-12
Posts: 142

Re: adblocking with /etc/hosts and connman

The best documentation I've found is the Connman API documentation.   You might find the API document at this link interesting: http://git.kernel.org/cgit/network/conn … xt?id=HEAD.  Particulaly the section in properties called Nameservers and Nameservers.Configuration.  It definitely answers your question about global nameservers.  This is the API documentation, but I've found it very helpful in explaining what I might need to do using connmanctl.

I'm not sure if any of the GUI programs would implement the feature you need, but I just took a look at connmanctl and this looked like it may have worked:

$ connmanctl
connmanctl> config  wifi_00183991268a_426962624e65742d576972656c657373_managed_psk --nameservers 127.255.255.255
connmanctl> exit

Of course you will need to replace the service with name with the one that you are using on your system.  I also picked a nameserver I knew was wrong so I could see if the command actually "took".  The nameserver changed did seem to take.

Offline

Board footer

Powered by FluxBB