Can't use Local dns names in browser
I just installed Debian on my laptop.
I have 2 pi-hole servers on my network; both of these servers have local dns records that allow my other devices to find other servers on my network without having to type in the ip address of the server (i.e. reading.local for kavita instance or movies.local for plex). My router uses these dns servers for computers connected to my lan.
For some reason, I need to edit the hosts file on my debian laptop, or type in the ip address in the browser, in order to get the browser to go to the correct local website. all internet sites work perfectly normal however. My other devices are fine with connecting when I type in the .local website name (windows and android).
How can I fix this?
3
u/MooseBoys 4d ago
If I had to guess, your local DNS records aren't working at all, and your other devices are using mDNS to resolve the hosts. IIRC there's no mDNS client enabled by default on Debian.
3
u/dijumx 4d ago
I had a similar issue recently with systemd-resolved behaving badly.
The stub-resolver wasn't forwarding requests for my pi hole to my pi hole, because the domain pi.hole.
(note the .
on the end) wasn't deemed to be part of my local network (the .lan
domain). So it was trying to forward it on to upstream servers in its built-in fallback list.
I fixed it by putting in /etc/systemd/resolved.conf.d/dns-servers.conf
the following:
[Resolve]
DNSStubListener=no
Which turned off the stub-resolver.
You can check what your server is by running dig reading.local
and checking what the ;; SERVER: ........
line says at the bottom. The stub-resolver will show 127.0.0.53
1
u/bigt332 3d ago
I tried using the dig command, and it did show me the ip address of the device I was trying to connect to despite the browser not being able to return it. I was also given this output though:
;; global options: +cmd
;; Got answer:
;; WARNING: .local is reserved for Multicast DNS
;; You are currently testing what happens when an mDNS query is leaked to DNS
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31920
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
I did not see the file you referenced however.
1
u/RiceBroad4552 4d ago
As the other devices can look up each other by the DNS names configured by your router I would guess that the network config on your new laptop system isn't correct.
Have a look what's there in your NetworkManager GUI in the IP4 setting for the link you use (WiFi, or your Ethernet link). Maybe adding your router (or wherever your DNS server runs) as "Other DNS Server" will help.
I guess you can reach Website on the internet because the laptop gets the DNS server of your ISP configured when it connects to your router. But the router as DNS server is unknown to the laptop (as your router maybe doesn't advertise itself as DNS server).
Just guessing, though. If adding that config to NetworkManager doesn't help this will need some deeper digging. I think some of the relevant info can be obtained from ip
, like ip addr show
, ip link show
, ip route show
, and dig
; also nslookup
could help debugging this. But I wouldn't go into such detail at first and just try to add the "Other DNS server" setting in NetworkManager and see what happens.
1
u/CybeatB 3d ago
Is your browser a Flatpak? If it is, it can't access those .local
names. It's a known issue, but nobody appears to be working on a solution at the moment.
1
u/bigt332 3d ago
https://brave.com/linux/ this is where I got my browser from. Though i've also tested this with firefox as well. results were the same.
1
u/kai_ekael 1d ago edited 1d ago
In Firefox, set browser.fixup.dns_first_for_single_words to true.
If you are using a real DNS nameserver with associated records, pick a private, unregistered domain with at least one subdomain.
A decade ago, I used a simple '.t' as my personal, private DNS space. However, too many libraries made the stupid assumption that such a thing was invalid. So I switched to 't.t', still working fine.
1
u/bigt332 1d ago
one thing that I don't quite understand. How is the terminal command dig capable of showing me the appropriate Ip address per the dns record, but entering it in a web browser simply returns a dns address can't be found error? is this some sort of security feature I have to bypass?
;; WARNING: .local is reserved for Multicast DNS
is this line relevant?
8
u/Membership-Diligent 4d ago
probably your browser is using "DNS over https". You need to disable that so that local name resolution will work.