LibreELEC, DNS and connman

  • Hi,

    I've been running the latest LibreELEC on a Pi for some time - works great - thanks!

    I recently changed my networking infrastructure (from Draytek to Ubiquiti) and LibreELEC started failing in a seemingly weird manner. I've spent a little time digging in to it and I'll do more if I'm not misunderstanding things.

    I have various DNS entries on my gateway server. On various computers/VMs which use DHCP, it uses the gateway for the DNS server (10.1.1.1) and I can use nslookup to see my mediaserver (a Synology NAS).

    However, on my Pi/LibreELEC (which gets address using DHCP), it uses the connman default DNS servers (8.8.8.8 etc.).

    If I change Kodi to use manual IP configuration and set IP address, DNS servers etc, the UI seems to show that all ok but connman still uses 8.8.8.8 so I can't see my NAS when I set up the media libraries. If I try to update connman using connman config... it seems to work ok (i.e. no errors) but doesn't change anything - the connman.conf file remains unchanged as does resolv.conf. As the conf file is on a RO filesystem, I can't update it manually (and I'd not expect to have to do that). On tp of that, I try to set the username/password for the NAS so I can delete/manage my library but that gets ignored in the UI (which seems odd - it previously worked for me and I'm sure there would be lots of people mentioning it if it was a bug).

    The Pi is running off a SD card and I'm wondering as I type this if that's reached the end of its life somehow and I just need to replace that.

    I've seen this which I'm reading as my expectations of behaviour are correct, but I'm happy to be corrected: DHCP with Manual DNS - Bug Reports - LibreELEC Forum

    I've had a look through the kodi log file and I see no errors about the settings but I can look further if I'm not making a schoolboy error!


    Many thanks

  • Look at /etc/resolv.conf and see what nameservers and search suffix domains are there.

    Here's mine:

    # Generated by Connection Manager
    search thebinks.com
    nameserver 192.168.0.5
    nameserver 192.168.0.15


    Connman creates this file and this is what Linux uses for resolving DNS. These are my DNS serves and local domain search order.


    Thanks,

    Jeff

  • Hi Jeff,

    Sorry, I should have said that I'd looked at resolv.conf and it reflected the connman.conf file:

    pikodisnug:~ # cat /etc/resolv.conf
    nameserver 8.8.8.8
    nameserver 8.8.4.4
    pikodisnug:~ #

    I should have also said that after the initial realisation of an issue, I reset kodi by renaming ~/.kodi and rebooting.

  • Can you remember how you got the searchdomain in your resolv.conf (did you edit it manually and then not reboot - connman rewrites resolv.conf on boot)?

    I've just created a new installation of LibreELEC on a new SD card and am seeing the same behavior which tells me something.

    I was using a wired connection but created a wireless connection, disabled the wired connection, rebooted and everything (so far) is behaving as I'd expect.

    So it looks like an issue with my wired connection; I'm assuming it's specific to *my* wired connection so I'll dig into that.

    If you or anyone has any suggestions or questions, let me know and I'll report back. All seems rather odd and I'm hoping I've just made a silly error in my network infrastructure setup but I can't think what that could be.

  • Can you remember how you got the searchdomain in your resolv.conf (did you edit it manually and then not reboot - connman rewrites resolv.conf on boot)?


    I use the LibreElec addon. I edit the connection, change everything to manual, set the DNS servers, DNS domains (this si where the suffix search order gets set) and NTP servers. LibreElec then writes out the resolv.conf file.


    Jeff

  • Thanks. That's what's odd for me - it shows as having DNS servers etc. set but doesn't write the files out.

    (as an FYI I'm pretty sure LibreELEC isn't writing the resolv.conf file itself - it's done by connman, but happy to be told otherwise).


    rgds

  • Thanks. That's what's odd for me - it shows as having DNS servers etc. set but doesn't write the files out.

    (as an FYI I'm pretty sure LibreELEC isn't writing the resolv.conf file itself - it's done by connman, but happy to be told otherwise).


    The Libreelec team will need to help with answering this. I show resolv.conf linked to /run/libreelec/resolv.conf


    Jeff

  • ConnMan owns resolv.conf and it exists in /run which is not persistent over reboots. You can configure things using the settings add-on which has a dbus-agent that speaks to connmanctl, or by using connmanctl from the CLI, or by cloning /etc/connman/main.conf to /storage/.config/connman_main.conf and editing defaults there (reboot to effect changes).