Score:0

How to set up Ubuntu system to use DNS on LAN host for local names

ca flag

I've set up dnsmasq on a Raspberry Pi, and would like all my hosts on the LAN to use it. I have set the Pi's IP address in the router as primary DNS server. However, something in the Ubuntu system is bypassing that.

$ dig dummyhost @raspberrypi works.

$ dig dummyhost @router works.

$ dig dummyhost fails.

Please help: what do I need to configure to make it happen?

ar flag
Which distro and version of Linux are you using?
Terrance avatar
id flag
Not sure what router you have, but the DNS / DHCP might be easier from the router than the Pihole side. I have my router send the IP of my PiHole as my first DNS record. Then I have my router as my second DNS record. After that I replaced my `/etc/resolv.conf` with the `/run/systemd/resolv/resolv.conf` file instead of the `/run/systemd/resolv/stub-resolv.conf` that way it lists my choice of DNS in the `/etc/resolv.conf` file instead of the `127.0.0.1#53`.
Score:0
ca flag

Thanks for responding.

FWIW, Xubuntu 22.04.

My /etc/resolv.conf was linked to /run/resolvconf/resolv.conf, so I tried replacing it with ../run/systemd/resolve/resolv.conf (note the extra e on resolv!) and all then worked perfectly.

One thing that has always puzzled me: since most routers offer DHCP, why do they not also offer DNS for local hostnames, since they have exactly the required data?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.