Configure DNSmasq on Ubiquiti EdgeMax routers

    January 6th, 2021


    DNSmasq for DHCP can be used as an alternative to ISC DHCPD as the backend for the EdgeRouter. The main advantage to using it is to speed up the resolution of local hostnames. This tutorial will show you how to configure it on the EdgeMax Routers.


    Firmware 1.9.0 or higher

    Step 1

    Access the EdgeOS CLI either via the GUI or an SSH session

    Step 2

    Type configure when prompted to enter configuration mode.

    Type set service dhcp-server use-dnsmasq enable and then commit, save and exit

    Step 3

    Type set system name-server to allow a loop back to the route itself

    Type set service dns forwarding name-server to set Google's DNS to resolve all external resolutions

    Set DNS Forwarding listen-on for all LAN interfaces (including VLANs) by typing set service dns forwarding listen-on eth1 then set service dns forwarding listen-on eth1.20

    Optional: You can increase the dns forwarding cache by running the command set service dns forwarding cache-size 400. You would just change the 400 to your preferable cache size.

    Step 4

    Set System domain-name by typing set system domain-name home.local

    Set a domain name for your DHCP servers by typing set service dhcp-server shared-network-name management subnet domain-name home.local

    If using a device,such as Cloudkey, you can set a static host mapping by typing set service dhcp-server shared-network-name Management subnet static-mapping cloudkey ip-address

    Step 5

    Remember to type the commit command to save your changes. You can view your current DHCP leases by typing cat /var/run/dnsmasq-dhcp.leases.

    Was this article helpful?

    Send feedback

    Can’t find what you’re looking for?

    Pilot’s local support team is here for you.

    Contact Support