Skip to content
DHCP/DNS server for Arduino
Java C++ C
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.


DHCP Lite library for Arduino v0.14

This library implements DHCP and DNS server processing for Arduino.

The library has been tested on Arduino Uno/Duemilanove. It correctly
handles requests from clients running Windows Vista, Ubuntu 11.04,
and iOS v.2, v.4 and v.5. See LIMITATIONS and KNOWN BUGS.

Visit for updates.


I have been looking for DHCP server library for Arduino and while
there are several libraries mentioned in Arduino forums (most notably,, and
Nebster's DHCP server code from this forum thread, 
some used UDP libraries I could not use and some I simply could not 
get to work.

I wrote this library in a way that should be easy to integrate with
other network libraries as it only takes a buffer (that is expected 
to have a DHCP message or DNS message) and compiles a response using 
the same buffer.


Copy the content of examples/ and libraries/ to your 
Arduino folders: arduino/examples/ and arduino/libraries/.


The library has no external dependencies.

The example is using RedFly library that comes with RedFly shield
(both are available at


Only DHCP REQUEST and DHCP DISCOVER messages are being handled.
All DHCP INFORM messages get DHCP NAK in response.
Only 12 leases are tracked by default.


Windows Vista (and possibly other versions of Windows) seems to rely on 
DNS Suffix Search List rather than Connection-specific DNS suffix in 
generating fully qualified hostnames (
This means that even though you can set your domain name to ""
and the DHCP server will report this using option 15, when you try to
resolve "arduino", it will send a request for "",
rather than "" (which will fail to resolve).

If you know how to fix this, send me an email.


Paul Kulchenko (


See LICENSE file


Mar 17 2012  v0.14  Updated the example to store WiFi configuration in
                    EEPROM and to provide a web interface to update it.
Mar 10 2012  v0.12  Updated to work with Arduino 1.0.
Nov 16 2011  v0.10  Fixed a bug with incorrect CRC being stored when IP 
                    address is assigned, which caused incorrect processing
                    of multiple DHCP REQUEST messages from the same IP.
                    This fixed the issue with iOS and MacOS clients.
                    Thanks to David Simmons for assistance.
Nov 12 2011  v0.06  Added AJAX example with keep-alive to read real-time data 
                    over HTTP.
Nov 07 2011  v0.05  Added options for renewal and rebinding timers. 
                    Cleaned up code.
Oct 30 2011  v0.04  Added conversion to lowercase hostname and a check for 
                    simple hostname to DNS processing.
Oct 29 2011  v0.03  Added DNS processing.
Oct 29 2011  v0.02  Updated hash to a longer and more robust version.
Oct 28 2011  v0.01  First release.
You can’t perform that action at this time.