Still confused on how to announce OpenWrt as DNS server

Hey there

Actually, I thought I understood how to advertise unbound as a DNS server for clients in the OpenWrt router's network. So far I have configured the following:

Interfaces -> lan -> DHCP Server -> Advanced Settings -> DHCP-Options

option:dns-server,0.0.0.0

Now I also wanted to provide OpenWrt as an NTP time server for the clients, for which I would set "42" in the same option. But then I saw the description for the DHCP options in Luci (must have been added with the last update, as I cannot remember it being there before):

Define additional DHCP options, for example "6,192.168.2.1,192.168.2.2" which advertises different DNS servers to clients.

The example uses option "6" instead of "option:dns-server". Are both options equivalent?

I also stumbled across this thread [Solved] Difference between setting DNS in DHCP-Options, “Use custom DNS servers”, or DNS Forwardings and now I am wondering whether setting this option for advertising unbound/OpenWrt as DNS server is even necessary or correct.

Using option numbers a is only needed for non-standard options that do not have a name. So, using option 6 or "dns-server" has the same effect. Additionally, dnsmasq advertises itself as DNS server by default.

1 Like

I use unbound instead, with dnsmasq listening on a different port. And maybe because of this, "option:dns-server" is necessary for a working connection.

And, not directly related to the DNS servers but to DHCP options, setting "42,0.0.0.0" is required for NTP advertising, right? Because in the Wiki only enabling the NTP server function is mentioned. The need for setting option "42" was, however, described in the forum.

Yes, it is required. And to be clear if you wish to announce the OpenWrt:

  • Enable NTP server under the system menu [in LuCI]

The DHCP DNS Option (No. 6) does not state ports. You will need to redirect the DNS requests , or configure your unbound and dnsmasq vice versa to eliminate that need.

1 Like

Sounds good.

I have configured unbound to listen on port 53 and moved dnsmasq to port 1053. I also set dnsmasq as DHCP link in the DHCP options of unbound. I thought, by doing so I had implemented the appropriate redirection. Since the DHCP option is still required, does this mean, OpenWrt still advertises dnsmasq to the client as a DNS cache and this is overridden by the DHCP option? What do I need to change so that I no longer need this DHCP option?

Advertising is one side, accepting is another side. I have devices in my home network, which ignore the ntp-server advertisement.

2 Likes