My department has a development network that is based on the idea of bringing up lots of local LANs for testing equipment in various configurations. The bridging development network connecting these local LANs is for management purposes.

  • The dev network is
  • There may be local LANs in,, and
  • Each local LAN has its own local router/DHCP server gateway
  • The gateway routers for the local LANs are given static IP addresses in, with the upstream being the primary router on the dev network
  • The primary router on the dev network runs a DHCP server for random clients we want to connect (workstations, etc)
  • The primary router on the dev network has routes assigned so local LAN-bound traffic is directed to the IP of the local LAN gateway
    • For example, if a local LAN gateway has the IP and the DHCP block, then a route set on the primary router sends all traffic bound for to
    • This allows for routing between devices behind different gateways

The Problem

I want to do the same thing with DNS that I do with the routing. I.E, I want devices behind different gateways to be able to resolve each others names.

Currently, both the gateways and the main router all run Dnsmasq for their DHCP servers so DNS entries are resolvable within each local LAN. And, since the gateways use the main router as their upstream DNS server, devices on the dev network are resolvable by devices behind gateways.

However, devices behind one gateway cannot resolve the names of devices behind a different gateway.

The Solution

I'd like to run a separate DNS server that I can point all the routers (both the primary router and the gateways) at. This DNS server would, ideally, reach out to all the routers and import all the local DNS entries that Dnsmasq has registered for its currently leased clients. Thus by pointing my client at this master DNS server I can resolve any internal hostname.

The question(s)

Is this possible? If so, what are some resources to get me started?

If not, what might I need to change to get the same functionality?

Is there a better way to do this? If so, what is it?

For reference, the primary router is a Ubiquiti EdgeRouter-4, while the gateways are Ubiquiti EdgeRouter-X's

1 Answer 1


From the man page


Whenever a new DHCP lease is created, or an old one destroyed, or a TFTP file transfer completes, the executable specified by this option is run. ...

Use this script to do an nsupdate on the main DNS server. The main server can't be dnsmasq because dnsmasq doesn't support this kind of update. Use a normal bind server and configure it to accept the updates.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.