You are not logged in.

#1 2022-12-18 00:42:19

ttshaw1
Member
Registered: 2020-04-12
Posts: 47

[Solved] Local network DNS not working

I'm trying to figure out why DNS doesn't work for hosts on my local network. For example, I have a raspberry pi with hostname raspberrypi. I'd expect that I could ping it as raspberrypi.local, but I get "Temporary failure in name resolution".

But the pi, which runs raspbian, can ping my desktop by hostname. I can ping by IP without issue. I also have no issues accessing webpages by URL. It's strictly an issue of my computer not knowing how to access other devices in the local network by IP.

My router knows the hostname and IP of every device on the network. It definitely runs the DHCP server; I presume that's either the same as running a local DNS server or it does that, too. The network stack on my computer is based around networkmanager. As far as I can remember I haven't installed any packages that would duplicate networkmanager functionality.

I think what I want to do is to have my computer query my router for every DNS request. So I created

/etc/NetworkManager/conf.d/dns-servers.conf

[global-dns-domain-*]
servers=(IP of my router)

Following https://wiki.archlinux.org/title/Networ … NS_servers. But after restarting my computer, nothing has changed. How can I further troubleshoot this?

Last edited by ttshaw1 (2022-12-18 02:14:46)

Offline

#2 2022-12-18 01:08:42

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [Solved] Local network DNS not working

Most consumer routers don't act as a DNS server for local addresses, only for internet addresses. You probably need to set up something like...
https://wiki.archlinux.org/title/Avahi


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2022-12-18 01:26:30

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,178

Re: [Solved] Local network DNS not working

Maybe something in https://wiki.archlinux.org/title/Domain_name_resolution helps?

DHCP is about assigning ip addresses to clients or requesting and receiving ip address assignments from DHCP servers. It's relevant only if you use dynamic rather than fixed IP addresses. That's not the same as DNS which is about turning domain names into IP addresses. You need DNS even with a fixed IP address. You only wouldn't need DNS if you entered all IP addresses directly without ever using regular URL names e.g. you only put things like '123.4.5.6' into your web browser rather than thinks like 'archlinux.org'. Changing the global DNS server probably didn't change anything, because your router was probably configured as the DNS server anyway.

It's unlikely, as far as I know, that your router is providing you with DNS itself because somebody (e.g. you) would have had to deliberately set up a DNS server. It isn't the kind of thing which just happens by default. More likely your router is passing your DNS requests on to, and returning the results from, another server (e.g. one provided by your ISP). But I don't think that matters here because you're just talking about resolving local names.

Last edited by cfr (2022-12-18 01:29:09)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#4 2022-12-18 02:14:30

ttshaw1
Member
Registered: 2020-04-12
Posts: 47

Re: [Solved] Local network DNS not working

I installed avahi and enabled its service. It just works. Thanks for the advice.

It's interesting that avahi just multicasts a message asking the hostname I want to identify itself. How is every device responding to avahi's request without my having configured that behavior? How does my router know the connected hostnames and IPs?

Offline

#5 2022-12-18 02:43:41

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,178

Re: [Solved] Local network DNS not working

Your router knows the IPs because it assigns them. It's running the DHCP server which doles out IP addresses according to whatever policy set on the router. That's how each device ends up with a unique IP on your network: the router won't give the same IP out to two devices simultaneously. I worked on a campus once where there was a severe shortage of IP addresses and it was quite often impossible to connect to the network because all of the available IP addresses were already assigned. You had to wait for somebody to get off the network and hope your machine requested an IP address before one of the others competing for it.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#6 2022-12-18 09:07:55

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,411

Re: [Solved] Local network DNS not working

How is every device responding to avahi's request without my having configured that behavior?

"avahi" = "bonjour" = "zeroconf", the entire purpose is to created ad-hoc discovery w/o any user configuration.
https://en.wikipedia.org/wiki/Zero-conf … networking

As long as it wrks, it works. Troubles start when it doesn't wink

Offline

Board footer

Powered by FluxBB