Add Static DNS Entries to DD-WRT Router Firmware

It is easy to add static DNS entries to the dd-wrt GUI interface. Follow the below simple steps and then reboot your router. In the below directions the dd-wrt version is v24-sp2.

  1. Login: First login to your wired or wireless router that is running dd-wrt software.
  2. Open Services: Click the “Services” tab which will default to the “Services” sub tab as well.
  3. Modify DNSMasq Settings: Scroll down to the “DNSMasq” section.
  4. Enable DNSMasq and Local DNS: Select the radial button next to Enable for both “DNSMasq” and “Local DNS”. Then click the Save button at the bottom of the screen.
  5. Add Static DNS Entries: In the “Additional DNSMasq Options” text field add entries in the below format.
    address=/host.domain.com/secondary.domain.com/192.168.1.10
    address=/router.domain.com/wrt54g.domain.com/192.168.1.1
    

    Note you can add multiple names for each IP address separating with a forward slash. Multiple entries are created just by adding a new line as shown above. Now click the “Save” button at the bottom of the screen.

  6. Save, Apply, and Reboot: Now click “Save” button followed by the “Apply Settings” button. Next click the Administration tab, scroll to the bottom, and click the “Reboot Router” button.

This is a great feature for adding static DNS entries for your local network. You can verify DNS is operational on the router after enabling DNSMasq by port scanning the device and making sure that it is now listening on port 53.

To test from a windows client open a command prompt and type the below. In this example the routers IP address is 192.168.1.1.

C:>ping router

Pinging router.domain.com [192.168.1.1] with 32 bytes of data:

Reply from 192.168.1.1: bytes=32 time<1ms TTL=64
Reply from 192.168.1.1: bytes=32 time<1ms TTL=64
Reply from 192.168.1.1: bytes=32 time<1ms TTL=64
Reply from 192.168.1.1: bytes=32 time<1ms TTL=64

Ping statistics for 192.168.1.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:>
Share