Raspberry Pi 2 resolv.conf

Hello,

I’m having this problem that my resolv.conf isn’t really filled in correctly after reboot.
I changed my network settings (/etc/network/interfaces) to contains:

auto eth0
iface eth0 inet dhcp
dns-search testDomain
dns-nameservers 172.16.2.11

After this I restart my raspberry, and look into /etc/resolv.conf, this file contains:

# Generated by Connection Manager
nameserver 127.0.0.1
nameserver ::1

When I run: sudo resolvconf -u
Then file contains the correct information:

search testDomain
nameserver 172.16.2.11

But after reboot it resets to the old config :frowning:
I have tried several things but haven’t figured out a way to make my resolv.conf file have the correct information.
Also in raspbmc when I had dhcp on the ‘NetworkManager’ filled my resolv.conf correct without me having to do anything:

# Generated by NetworkManager
domain testDomain
search testDomain
nameserver 172.16.2.11

Does anybody have an idea on what is going wrong?

Thanks

Hi,

I think you misunderstand how networking is set up on OSMC, so you are trying to “fight the system”.

We don’t use network manager, therefore network settings in /etc/network/interfaces do not do anything. We use Intel connman (connection manager) to manage the network configuration.

As part of this we have the dns forwarder/proxy feature of connman enabled by default (except for NFS installs) which means your resolv.conf will always have 127.0.0.1 as the nameserver - this is correct.

If you want to configure your network settings the recommend way is through the networking module in OSMC Settings, or if you would rather do it from the command line you can use ‘connmanctl’.

BTW, did you happen to install the network-manager package manually ? If so you should remove that, as it will fight for control of the network interfaces with connman…