NSLU2-Linux
view · edit · print · history

Dnsmasq is a combination DNS and DHCP server.
IP addresses handed out to DHCP clients are automatically added to the name service.
Configuration is easy.

  • Upstream name servers are read from the configuration file.
  • Local addresses are read from a host file ( default /etc/hosts .)
  • DHCP address ranges and static reservations are read from the configuration file.

Installing:

  1. ipkg update
  2. ipkg install dnsmasq

Configuring:

  • edit /etc/hosts to add hosts to the dns.
  • edit /opt/etc/dnsmasque.conf to configure all dns and dhcp settings.



Dnsmasque.conf:


## dns part 

# filter what we send upstream
domain-needed
bogus-priv
filterwin2k

# If you don't want dnsmasq to read /etc/resolv.conf or any other
# file, getting its servers for this file instead (see below), then
# uncomment this
no-resolv

# If you don't want dnsmasq to poll /etc/resolv.conf or other resolv
# files for changes and re-read them then uncomment this.
no-poll

# Add other name servers here, with domain specs if they are for
# non-public domains.
# => Dns servers from planet.nl
server=195.121.1.34
server=195.121.1.66

# Add local-only domains here, queries in these domains are answered
# from /etc/hosts or DHCP only.
local=/your.host.name/

# If you want dnsmasq to listen for requests only on specified interfaces
# (and the loopback) give the name of the interface (eg eth0) here.
# Repeat the line for more than one interface.
#interface=
# Or you can specify which interface _not_ to listen on
except-interface=ipx0

# Set this (and domain: see below) if you want to have a domain
# automatically added to simple names in a hosts-file.
expand-hosts

## dhcp part

# enable dhcp (start,end,netmask,leasetime)
#dhcp-authoritative
dhcp-range=192.168.1.100,192.168.1.110,255.255.255.0,48h

# Always allocate the host with ethernet address 00:0E:8E:02:1B:5B 
# The IP address 192.168.1.69 (this can be out of the dhcp range
dhcp-host=00:0E:8E:02:1B:5B,192.168.1.69


# dhcp lease file
dhcp-leasefile=/tmp/dhcp.leases

#default gateway ip (modem)
dhcp-option=3,192.168.1.1
# default dns server (the ip from the nslu2)
dhcp-option=6,192.168.1.77

## end of config file

Problems:

With the oleg firmware and IPv6?, dnsmasq won't start. Is there a compile switch to disable IPv6? or a different solution?

view · edit · print · history · Last edited by Wary.
Based on work by BrianZhou, mika, and Jelle.
Originally by Gerald L Clark.
Page last modified on July 23, 2008, at 04:55 PM