Somewhat esorteric problem - I'm using pihole as a "local dns". My pihole is running stretch, kernel version 4.19.66. I have a line in /etc/hosts that looks like this:
192.168.75.51 myhost.mydomain hosta hostb
From there, I can ping myhost, hosta or hostb and get results
From any OTHER server on my network running Linux kernel 4.x; ping also works as above,
HOWEVER- from ANY server (including some Oracle Linux and Ubuntu boxes) running Linux 5.x and above:
ping myhost
or
ping hosta
work fine; but,
ping hostb returns "hostb: Name or service not known"
I'd appreciate any thoughts, and any possible solutions, or at least better idea on where to report this
Clay
N7QNM
Re: multiple aliases in /etc/hosts broken in 5.x kernel
I thought pi-hole maintained local names directly and not via the hosts file i.e. you have to use its GUI to do the changes?
Other thoughts:
1) Pi-hole has caches entries and you added the second alias entry after starting pi-hole
2) Try adding two lines, each lines having only one alias
3) Try the Buster version of the O/S
Other thoughts:
1) Pi-hole has caches entries and you added the second alias entry after starting pi-hole
2) Try adding two lines, each lines having only one alias
3) Try the Buster version of the O/S
Old sig removed given the current world situation. Please wish / pray / work for a peaceful world.
Re: multiple aliases in /etc/hosts broken in 5.x kernel
I think Pi-hole uses dnsmasq which uses both its own files and the local /etc/hosts for hostname lookups.
Unreadable squiggle
Re: multiple aliases in /etc/hosts broken in 5.x kernel
I don't know why there seems to be a difference in behaviour between 4.x and 5.x kernels, but assuming you're running the latest version of Pi-hole, you should have a 'Local DNS' entry in the menu down the left-hand side on the web UI. If you put your local DNS entries in there it should work. That also has the advantage that you are defining all your DNS settings in the same place, i.e. Pi-hole.N7QNM wrote: ↑Mon Oct 04, 2021 5:42 amSomewhat esorteric problem - I'm using pihole as a "local dns". My pihole is running stretch, kernel version 4.19.66. I have a line in /etc/hosts that looks like this:
192.168.75.51 myhost.mydomain hosta hostb
From there, I can ping myhost, hosta or hostb and get results
From any OTHER server on my network running Linux kernel 4.x; ping also works as above,
HOWEVER- from ANY server (including some Oracle Linux and Ubuntu boxes) running Linux 5.x and above:
ping myhost
or
ping hosta
work fine; but,
ping hostb returns "hostb: Name or service not known"
I'd appreciate any thoughts, and any possible solutions, or at least better idea on where to report this
Clay
N7QNM
Last edited by andrum99 on Mon Nov 01, 2021 8:14 pm, edited 1 time in total.
-
- Posts: 1541
- Joined: Fri Jan 04, 2013 1:57 pm
- Location: de_DE
Re: multiple aliases in /etc/hosts broken in 5.x kernel
is there a specific reason why you use that an old OS version?
PS.: in the detailed change log of Pi-Hole 5.6 is maybe a related fix: "Validate host/domain of Local DNS records as well"
PPS.: Pi-Hole uses a modified version of dnsmasq (FTLDNS)
{ I only give negative feedback }
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)