Two OpenWrt routers on one network, but DNS only available on one

Sorry if this has been asked before, I searched and looked around and couldn't find anyone asking something that's similar to my situation.

I have a setup like this:

ISP ──────► ISP Modem
  into WAN port-│
                ▼         Powers main network
            OpenWrt 1 ─── DHCP server
                │         Assigns static leases
 into LAN1 port-│
                ▼         Only extends network
            OpenWrt 2 ─── DHCP disabled
                          !! fails to resolve .lan dns !!
  • OpenWrt 1
    • has DHCP enabled and is intended to be the router which manages the entire network
    • its hostname is router, so it provides router.lan
    • it also has a few assigned static leases, such as server.lan, etc
  • OpenWrt 2
    • OpenWrt 1's LAN1 port is connected to this devices LAN1 port
    • just intended to be a WiFi access point to the main network (extending the network further away)
    • DHCP is disabled, all devices connected to this get IP addresses from OpenWrt 1

When connected to OpenWrt 1's WiFi network, I have access to all the hostnames created by the static leases (i.e., router.lan, server.lan, etc).

My problem is the devices connected to OpenWrt 2's WiFi network: they cannot seem to resolve these hostnames for the static leases.

How can I debug this? I've tried various options under Luci -> Network -> DHCP and DNS to no avail.
Running nslookup server.lan on OpenWrt 2 returns an empty response.

are you sure it's set up as ?
in a dumb AP scenario all traffic is simply passed on to the up stream device, including DNS.

DNS lookups not working on an AP is pretty normal, APs don't require a DNS to work properly.

1 Like

on OpenWrt2 if interface lan a static adress add only option dns

config interface 'lan'
        option proto 'static'
        option device 'br-lan'
        option ipaddr ''
        option netmask ''
        option gateway ''
        list dns ''

on OpenWrt2 if interface lan a dhcp adress

post your /etc/resolv.conf

Ah, I had actually missed that page!

I had done all those steps, except for disabling the IPv6 settings, and disabling the dnsmasq, odhcpd and firewall services.

Disabling all that and rebooting the router has done the trick!

Thanks for the quick response! :heart:

1 Like

The interface on OpenWrt 2 was a DHCP Client rather than static, it was setup like

config interface 'lan'
	option device 'br-lan'
	option proto 'dhcp'
	option peerdns '0'

But, after following the guide linked by @frolic, it also has the list dns '' configuration added, which I think solved the problem too!

DHCP client should have worked too, since it only affects the device, not its clients,
the error would have been someplace else.

having two DHCP servers (dnsmasq) on the network isn't a great idea though ,)


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