The "server" option in dnsmasq does not take

root@OpenWrt:~# uci show dhcp|grep example.com
dhcp.@dnsmasq[0].server='/example.com/10.3.2.1'

I double checked and it's committed to /etc/config/dhcp too.

This didn't seem to work when querying subdomain.example.com. I added log-queries and log-facility to /etc/dnsmasq.conf , did a service dnsmasq restart and it confirmed: it didn't send to 10.3.2.1. But why?

https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html

Matching of domains is normally done on complete labels, so /google.com/ matches google.com and www.google.com but NOT supergoogle.com.

AH.

Two problems.

One, despite uci adds the config to /etc/config/dhcp the dnsmasq file generated doesn't contain the server option. Is this a bug? I think it is. The wiki lists server as a known option.

Two, when I moved it to /etc/dnsmasq.conf it didn't work because "possible DNS-rebind attack detected". Adding rebind-domain-ok="example.com" helped and now it works.

You must add those entries as a list, not an option:
https://openwrt.org/docs/guide-user/base-system/dhcp_configuration#dns_forwarding

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.