DNSMasq as DHCP server

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 17:19, 22 May 2006 (edit) (Talk)

← Previous diff
Revision as of 13:56, 9 July 2006 (edit) (undo) (Talk)
Next diff →
Line 12: Line 12:
*Using DNSMasq parameters *Using DNSMasq parameters
'''You can NOT use both''' '''You can NOT use both'''
=Setting it up= =Setting it up=

Revision as of 13:56, 9 July 2006



Some users reporting a bug with this - 22May06 - If having problems with setting Static IP address, disable DNSMasq - see link - DNSMasq bug?

DD-WRT supports using DNSMasq "as local DNS server" and also uses the DHCP service "udhcpd". This is a waste of RAM (router has 16MB total and only 3MB free). With DNSMasq as the sole DHCP server you can save 300kB (udhcpd deactivated!). With this savings you can create one more PPTP tunnel with the inserted PPTPD server.

There are two ways to accomplish this

  • Using the Web-Interface
  • Using DNSMasq parameters

You can NOT use both 989959162969900403918

Setting it up

Using Web-Admin

This is the easiest way to setup DNSMasq as DHCP Server

  • Go to your Web-Interface and log in
  • Go to Setup->Basic Setup
    • Make sure that
      • DHCP Type = DHCP Server
      • DHCP Server = enabled
      • Use DNSMasq for DHCP = checked


  • Go to Administration->Services
    • Make sure that
      • DHCP Daemon = enabled
  • You can add static allocations the same way when you're using DHCPd


Using DNSMasq parameters

Following steps are necessary:

  • deactivate the DHCPD service on the "Setup" page.
  • add in the options of the DNSMasq under "administration" (this must be also activated):

Static allocation:


AB:CD:EF:11:22:33 is the MAC of the network, indicates the desired IP, host and host.domain the hostname (e.g. Computer1.lan), and finally 12h the DHCP lease of 12 hours.

If you want to identify devices via name resolution and it's not possible to assign an IP with DNSMasq, you must add the following lines:


You must also add this computer to /tmp/hosts: printers drucker.lan 

Original Thread: http://blog.ptch.de/index.php?/archives/33-WRT54G-DNSMasq-als-DHCPD.html (German)

Extra DNSMasq options

There are some extra options you can set by entering them in Additional DHCPD Options

ISP DNS-Servers

If you wish to pass through the DNS servers from your ISP, you can use the following parameters:


x.x.x.x = DNS1
y.y.y.y = DNS2

Never offer DHCP service to specific MAC addresses

You can ignore requests from specific MAC addresses, so no IP address will be leased to those machines


11:22:33:44:55:66 = MAC address of the machine you wish to ignore

For more options take a look at http://www.faqs.org/rfcs/rfc2132.html

Disable NetBIOS over TCP/IP

Since DNSMasq acting as a local DNS server suitably takes care of host name resolution, disabling NetBT on appropriately configured Microsoft DHCP clients, such as Windows 2000 and XP, can be accomplished with the following: