How to set up dhcp_2_dns.sh
dhcp_2_dns.sh is a script which updates tinydns with addresses handed out by dhcpd. This is useful for Bering firewalls because DNS and DHCP will be synchronized.
Here’s how to set it up:
- First, make sure tinydns is set up and running (directions are here).
- Copy dhcp_2_dns.sh onto your firewall. I put my copy in /usr/bin/. Add /usr/bin/dhcp_2_dns.sh to /var/lib/lrpkg/tinydns.list:
... usr/bin/tinydns-data usr/bin/dhcp_2_dns.sh etc/tinydns-private/ ...
(This adds dhcp_2_dns.sh to the tinydns.lrp package).
- Edit /etc/init.d/tinydns so that dhcp_2_dns.sh is run every time tinydns starts. Add the call near the end of set_dnscache():
... echo "" > /var/run/resetdns.pid /usr/bin/dhcp_2_dns.sh # run dhcp_2_dns.sh RESET_DNS=Y } ...
- Back up tinydns.lrp
- Edit /etc/multicron-p and add dhcp_2_dns.sh to periodic():
periodic () { checkfreespace pingcheck /usr/bin/dhcp_2_dns.sh }
By default, periodic() is run every 15 minutes. This can be changed in /etc/cron.d/multicron.
- Back up etc.lrp