obsd_m...@chrissmith.org (Chris Smith), 2013.12.31 (Mon) 16:19 (CET): > Maybe it's a problem due to Unbound being a package and not part of > the core system, but a normal configuration such as: > > host hostname.example.com { > hardware ethernet 00:1a:80:f4:75:ad; > fixed-address hostname.example.com; > } > > has to be rewritten as: > > host hostname.example.com { > hardware ethernet 00:1a:30:64:75:bc; > fixed-address 172.38.202.17; > } > > thereby duplicating efforts or dhcpd will not start on reboot since > pkg scripts start after everything else and Unbound has not yet been > started.
Keep hosts(5) and unbound(8) in sync and ``lookup file bind'' in resolv.conf(5). That lets dhcpd(8) resolve your names before net/unbound(8) has come up. $ grep "^include: " /var/unbound/etc/unbound.conf.local include: "/var/unbound/etc/localzone.hosts.conf" $ getent hosts | hoststounbound.sh hosts > \ /var/unbound/etc/localzone.hosts.conf $ sudo unbound-control -c /var/unbound/etc/unbound.conf.local reload $ cat hoststounbound.sh # handle with care! #!/bin/sh -e local _zone=${1:-"hosts"} function _doit { local _zone="${1}" local _ip="" local _names="" local _name="" local _word_count="" local _word="" print "server:\n" print "local-zone: \"${_zone}\" transparent\n" while read _line; do [[ "X${_line}" == X"#"* ]] && continue _ip="" _names="" _word_count=0 for _word in $_line; do if [[ $_word_count -eq 0 ]]; then # first: ip _ip="${_word}" elif [[ "X${_word}" == X"#"* ]]; then # skip after # in line break else # remains: names and aliases _names="${_names}${_word} " fi _word_count=$((_word_count + 1)) done # skip localhost #[[ "X${_ip}" == X"127.0.0.1" || "X${_ip}" == X"::1" ]] && continue a="A" [[ "X${_ip}" == X*":"* ]] && a="AAAA" for _name in $_names; do print "local-data: \"${_name} ${a} ${_ip}\"" print "local-data-ptr: \"${_ip} ${_name}\"\n" done done } _doit "${_zone}" > Also as nice as it is to have the core dhcpd create pf tables it has > otherwise very limited functionality, such as lack of support for > "option space", which can be used to request a system release it's > lease on shutdown I could not figure out which dhcp option(s) you are referring to. Please specify option number and RFC number. For options with names see: dhcp-options(5) (beeing reworked currently) /usr/src/usr.sbin/dhcpd/tables.c For options without names use e.g. ``option-252'' > thereby keeping the created *_ip_tables more Do you mean pf.conf(5) tables here? Or dhcp leases table (/var/db/dhcpd.leases)? > up-to-date. Option space is also good for preventing some of the WPAD > nonsense and assisting in NetBIOS configurations. Could you be more specific, please? Bye, Marcus > Using the packaged dhcpd would most likely eliminate the startup issue > and provide the missing dhcpd functionality but one would also lose > the tight pf integration.