N7QNM
Posts: 9
Joined: Sun Apr 19, 2015 4:30 pm

multiple aliases in /etc/hosts broken in 5.x kernel

Mon Oct 04, 2021 5:42 am

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

MiscBits
Posts: 789
Joined: Wed Jan 27, 2021 12:48 pm

Re: multiple aliases in /etc/hosts broken in 5.x kernel

Tue Oct 05, 2021 12:57 pm

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
Old sig removed given the current world situation. Please wish / pray / work for a peaceful world.

User avatar
rpdom
Posts: 20045
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: multiple aliases in /etc/hosts broken in 5.x kernel

Tue Oct 05, 2021 8:26 pm

MiscBits wrote:
Tue Oct 05, 2021 12:57 pm
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?
I think Pi-hole uses dnsmasq which uses both its own files and the local /etc/hosts for hostname lookups.
Unreadable squiggle

andrum99
Posts: 1619
Joined: Fri Jul 20, 2012 2:41 pm

Re: multiple aliases in /etc/hosts broken in 5.x kernel

Tue Oct 05, 2021 10:10 pm

N7QNM wrote:
Mon Oct 04, 2021 5:42 am
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
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.
Last edited by andrum99 on Mon Nov 01, 2021 8:14 pm, edited 1 time in total.

beta-tester
Posts: 1541
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: multiple aliases in /etc/hosts broken in 5.x kernel

Sat Oct 30, 2021 7:29 am

N7QNM wrote:
Mon Oct 04, 2021 5:42 am
My pihole is running stretch, kernel version 4.19.66
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)

Return to “Raspberry Pi OS”