LibreELEC 9.0.1 on RaspPi 3+
(didn't work on 8.2.5 either so I upgraded to 9.0.1)
updated hosts file via '/storage/.config/hosts.conf' rebooted
name resolves using DNS provided by DHCP server. It "should" look at the hosts file first per the nsswitch.conf file:
However, when I try to ping it, I get the DNS IP returned instead of what I set manually...
Quote
# cat /etc/nsswitch.conf
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
#
passwd: files
group: files
shadow: files
gshadow: files
hosts: files mdns_minimal [NOTFOUND=return] dns <<<---------HERE
networks: files dns
protocols: files
services: files
ethers: files
rpc: files
netgroup: files
# cat /etc/hosts
# hosts.conf
# This configuration file allows you to manually map hostnames to
# IP addresses
# Format: <ipaddress> <hostname1> <hostname2>
# Example: 192.168.0.3 libreelec libreelec.mynetwork
# NOTE: do not edit /etc/hosts directly
# edit /storage/.config/hosts.conf then reboot
<host1> <IP2>
<host2> <IP2>
<host3> <IP2>
127.0.0.1 localhost <hostname>
::1 localhost ip6-localhost ip6-loopback <hostname>
# ping <host1>
PING <host1> (<IP1>): 56 data bytes
64 bytes from <IP1>: seq=0 ttl=246 time=36.021 ms <<<-------expected outcome is <IP2> from hosts file.
# nslookup <host1>
Server: <DNS#1 IP> <<<--------This should be 'localhost' I believe...
Address 1: <DNS#1 IP> <DNS#1 HOSTNAME>
Name: <host1>
Address 1: <IP1> server-<IP1>.<domain>
Display More
Obviously names and IP's have been redacted to protect the innocent.
I would like to add 127.0.0.1 as a nameserver in my resolv.conf file but it gets overwritten every time I reboot. I'd also like to keep the other three nameservers it gets from DHCP as well.
Any help on what else I can try or look at to get this thing to resolve the name from the hosts file properly?
Tried removing the 'r' from connman.service that I saw in another thread for caching DNS but that didn't work for my case.
TIA!