OpenWrt Forum Archive

Topic: DHCP + DNS DDNS Updates - Using ISC DHCPD with dnsmasq

The content of this topic has been archived on 8 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all,

I am running OpenWRT 7.09 on a Asus WL-500gP and would like to use ISC's DHCP server instead of dnsmasq. My aim is to be able to keep dnsmasq for dns queries whilst using ICS DHCPd for DHCP. I am finding it difficult to understand exactly how OpenWRT manages DHCP. My ISP offers my IP via DHCP so I need to be able to perform queries on my WAN interface. What I'm currently unsure of is if dnsmasq allow ddns-updates when using ICS's DHCP server. If it doesn't I guess I'll just have to switch to BIND but if I can save the extra space by using dnsmasq I'd prefer to.

Anyone done this before ? Any feedback ?

Regards,

John GILLESPIE

Why do you want to use ISC dhcp instead of dnsmasq? as a dhcp server, dnsmasq is almost on par with ISC dhcp. Most users find the limitations are in the DNS server parts of dnsmasq.

--DA

I have found it difficult to configure certain dhcp options with dnsmasq and I need to be able to set special options because I use VOIP phones on my lan.

Here's how you do what you want:

Change the dnsmasq startup script to just start dyndns masq:

#! /bin/sh

if [ "$1" == "stop" ] || [ "$1" == "restart" ]
then
  killall dnsmasq
fi

if [ -z "$1" ] || [ "$1" == "start" ] || [ "$1" == "restart" ]
then
  [ -f /etc/dnsmasq.conf ] || exit
  dnsmasq
fi

Make the config look like this:

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

# allow /etc/hosts and dhcp lookups via *.lan
domain=lan

# not sure if you need the some_ip lines or not
local=/lan/127.0.0.1
local=/lan/some_ip

local=//127.0.0.1
local=//some_ip

expand-hosts

dhcp-leasefile=/tmp/dhcpd.leases

And make sure the dhcp server gets started like this:

lease_file=/tmp/dhcpd.leases
config_file=/etc/dhcpd.conf
/usr/sbin/dhcpd -cf $config_file -lf $lease_file

The discussion might have continued from here.