OPNsense Forum

English Forums => 25.1, 25.4 Production Series => Topic started by: whatever on June 08, 2025, 07:21:47 PM

Title: DNSmasq 'no-resolv' issue
Post by: whatever on June 08, 2025, 07:21:47 PM
Hello,

I'm having a strange (I think) issue with DNSmasq. If I set it up to use the servers listed in System/Settings/General, everything works perfectly: I can go out to the internet and resolve local hostnames (as defined by the host overrides).

However, if I create a custom .conf file in /usr/local/etc/dnsmasq.conf.d/ with:

no-resolv
server=<dns server ip>

(using the same server that I would put in System/Settings/General), I can still go out to the internet but I lose local hostname resolution despite host overrides being defined.

Is this expected behavior?

Running 25.1.7_4.

Thanks
Title: Re: DNSmasq 'no-resolv' issue
Post by: whatever on June 09, 2025, 03:26:20 AM
Is anyone using 'no-resolv' without any side effects?
Title: Re: DNSmasq 'no-resolv' issue
Post by: meyergru on June 09, 2025, 09:10:35 AM
I would guess that no-resolv is not your problem, but server= is. If you do not limit the scope of that option, then all queries will get forwarded to that upstream server, effectively disabling any local resolution.
Title: Re: DNSmasq 'no-resolv' issue
Post by: whatever on June 09, 2025, 06:19:10 PM
Thanks for replying. I suspect you're correct.

However, I've tried defining local domains (local=/local.domain.1/ local=/local.domain.2/ - on separate lines). I've tried inserting bogus-priv. I've tried defining host overrides in the config (address=/local.domain.1/192.168.x.x). Whatever I do, local hostname resolution breaks.

I'm not a particularly advanced user regarding DNS, would you happen to know how to properly limit the scope of server=?

Cheers
Title: Re: DNSmasq 'no-resolv' issue
Post by: meyergru on June 09, 2025, 11:28:36 PM
Normally, you should not have to do that. Withe the next upcoming release, local= can be populated automatically by the static reservations, see the OpnSense DNSmasq docs.
Title: Re: DNSmasq 'no-resolv' issue
Post by: whatever on June 10, 2025, 02:18:50 AM
Thanks again for the reply.

The docs appear to imply that DNSmasq is used for dhcp. I'm using KEA at the moment and would really rather not go through transferring all my reservations again.

Do you happen to know how to manually restrict the scope of server= to have dnsmasq still perform hostname resolution according to the host overrides list?

Thanks
Title: Re: DNSmasq 'no-resolv' issue
Post by: meyergru on June 10, 2025, 07:29:37 AM
No, I have not used a Kea/DNSmasq combination yet.
Title: Re: DNSmasq 'no-resolv' issue
Post by: whatever on June 10, 2025, 07:45:27 PM
Thanks for taking the time to answer my questions.

If anyone is successfully using 'no-resolv' in DNSmasq, I'd love to hear from you.

Cheers