Thanks macMeck.
Solution below works, but could probably be replaced by a more elegant solution involving changing /etc/init.d/dnsmasq.
1. Create script /etc/config/staticlease2dns.sh
with these contents
#!/bin/sh
# staticlease2dns.sh
# Takes dnsmasq DHCP fixed leases and
# updates list of names+ip addresses to be used by dnsmasq
# This script can be run periodically by crontab or another mechanism
# Prerequisites:
# - openwrt or other system running dnsmasq that
# - stores fixed lease info in /etc/config/ in this format
#dhcp-host=00:11:22:33:44:55,192.168.1.2,myhostname
# - has the dnsmasq addnhosts/-H parameter set to /tmp/etc/fixedleases.conf to pick up the script output
# Only take the lines containing dhcp-host; extract ip address and hostname, and write to file:
grep dhcp-host= /tmp/etc/dnsmasq.conf | cut -f 2,3 -s -d , | sed 's/,/ /g' > /tmp/etc/fixedleases.conf
# Get dnsmasq to reload hostname data by sending SIGHUP
killall -1 dnsmasq
2. Make it executable
chmod ugo+rx /etc/config/staticlease2dns.sh
3. Make it run every hour
in web interface, system, scheduled tasks,
# update DNS names with dhcp static leases list every hour
01 * * * * /etc/config/staticlease2dns.sh > /dev/null
4. set up dnsmasq to read the generated file:
in web interface, network, DHCP and DNS, Server Settings, Resolv and Hosts files
set Additional Hosts files to
/tmp/etc/fixedleases.conf