Dnsmasq authoratative only for single host

Started by nintendoeats, November 07, 2026, 07:59:05 PM

Previous topic - Next topic
Bonjour,

I am using Dnsmasq for both DNS and DHCP. All has been well so far, but now I want to globally override a public server with my own mirror. Problem is, I am not mirroring the whole domain, only part of it. I would like to prevent upstream requests for bar.foo.com and baz.foo.com, but not *.foo.com like the Local option does.

I'm getting the impression that this behaviour is just outside the scope of Dnsmasq, and that the expectation is you will set up a different nameserver to differentiate these queries. Am I mistaken?

Thanks

Host overrides should have a higher priority than domain overrides.

Try the following:
- Add a domain override for bar.com with the IP address 8.8.8.8
- Add a host override for foo.bar.com with, for example, 192.168.1.1

It worked here in a quick test.
Since my internal domain is internal.bar.com, this behavior might not be directly applicable.
(Dnsmasq is still a mystery to me.)

Quote from: stefanpf on November 08, 2026, 06:08:10 AMTry the following:
- Add a domain override for bar.com with the IP address 8.8.8.8
- Add a host override for foo.bar.com with, for example, 192.168.1.1

Thanks, that worked! I did have to assign an IPv6 address to the local server, and there is still an alias record appearing, but I'm sure I can resolve that too.

One day, in the far flung future, when I change my DNS setup and forget about this entry, I will be wondering why I can access every website except for foo.com...

Quote from: stefanpf on November 08, 2026, 06:08:10 AM(Dnsmasq is still a mystery to me.)
What's bothering you exactly ?!

It's pretty simple :
- It does DHCP stuff.
(Just no IPv6 Prefix Delegation like KEA !!)
- It does DNS stuff.

And everything you need to know is @ https://dnsmasq.org/docs/dnsmasq-man.html

But maybe I am used to it too much because it's part of Pi-Hole FTLDNS and I have been using that in combination with https://docs.pi-hole.net/guides/dns/unbound/ for many years now :)
Weird guy who likes everything Linux and *BSD on PC/Laptop/Tablet/Mobile and funny little ARM based boards :)

Quote from: nero355 on November 08, 2026, 06:13:56 PMWhat's bothering you exactly ?!

Yeah, tbh I'm using it because it's the DHCP/DNS system in OPNsense that I can get my head around. Assign name and IP to host via MAC, there is no step 2.