Dnsmasq is an opensource light-weight,easy to configure and administer DNS and a DHCP Server. Dnsmasq is ideally suitable for smaller networks like Small Office and Home Office networks (SOHO) and branch office networks. Dnsmasq can be run on old PC and is very easy to configure and administer. Dnsmasq is seen to support upto 1000 nodes on a network.
In essence, Dnsmasq is a Caching nameserver and a DNS forwarder with DHCP enabled on it. Dnsmasq can provide nameservice for local hosts while forwarding the queries for global public resources to a Public DNS Server (like an ISP DNS server). So, small networks which are behind a DSL/ADSL router or even a modem link and share a single internet connection can make the best use of Dnsmasq.
Dnsmasq is included in most of the opensource firewalls and opensource router firmware and in the most common Linux distributions. Some of them include:
IPCop / Smoothwall / floppyfw / Firebox / LEAF / m0n0wall / PfSense / Endian Firewall / ClarkConnect
Opensource router firmware:
dd-wrt / openwrt / stock firmware / fli4l
Debian / Gentoo / Slackware / Suse / Fedora / Coyote Linux
FreeBSD / OpenBSD / NetBSD
Some of the highlighting features of Dnsmasq are as follows:
- Automatically update the Public DNS Servers through PPP or DHCP connections. So, change in a Public DNS server of an ISP that the network is connected to will be picked up by Dnsmasq
- Caching Nameserver to reduce network traffic and improve performance
- Forwarding to Private DNS servers for specific Domains can be configured
- Nameservice for the localhosts using the /etc/hosts file and for DHCP Client hosts
- Static and Dynamic client leases on DHCP
- Multiple Network and IP Ranges on the DHCP server
- BOOTP support for network booting using a secure read-only TFTP server
- Simple global configuration using the /etc/dnsmasq.conf file
- Supports BOOTP and DHCP Relays
- Caches A records for IPv4 and AAAA records for IPv6 and PTR records
- Supports IPv4 and IPv6 protocols and even can act as a IPv4 toIPv6 and IPv6 to IPv4 forwarder
- Support MX records and SRV records for local machines
- Block DNS redirect websites (like some websites which forward to a link for a website that doesn't exist)
Dnsmasq does the name lookup from its /etc/hosts file and hence its all about maintaining a /etc/hosts file on one computer as against multiple PCs on the LAN. If the host is a DHCP client then even if there isn't an entry for the host in the "hosts" file it can still provide name resolution for the host.
Effectively, all hosts in the LAN will have the dnsmasq server as the nameserver in /etc/resolv.conf file (In windows under network connection) and you dont have to worry about the "hosts" file on the local system.
The /etc/hosts file on the Dnsmasq server can have only the hostname without the domain name (example: host1 instead of host1.mynetwork.com) as the domain name can be appended globally using configurations in the /etc/dnsmasq.conf file.
It's got .deb and rpm packages for Debian, Fedora and other distributions and also can be built from the Source files. For more information and download, click here for dnsmasq home page.