Here’s a drop-in solution that meets all of your requirements:
- doesn’t serve DHCP
- is lightweight-ish and ubiquitous
- supports RFC-2136 “dynamic updates” (DDNS)
- forwards everything outside *.office.internal to dns.usc.edu
The tool of choice: BIND9
(You could equally use PowerDNS Authoritative + SQLite/REST-API, or Knot DNS with its dynamic-update plugin—but BIND9 is by far the most battle-tested and easiest to get going.)
1. Install BIND9
On Debian/Ubuntu:
apt update
apt install bind9 bind9utils
On RHEL/CentOS:
yum install bind bind-utils
2. Create a TSIG key for secure DDNS
We’ll use HMAC-SHA256:
cd /etc/bind
dnssec-keygen -a HMAC-SHA256 -b 256 -n HOST ddns_key
# this emits two files: Kddns_key.+165+<ID>.key and Kddns_key.+165+<ID>.private
Extract the key into your named.conf:
cat << EOF >> /etc/bind/named.conf.local
key "ddns_key" {
algorithm hmac-sha256;
secret "PASTE_THE_BASE64_FROM_.private HERE";
};
EOF
(Or include the generated .private file directly, e.g.
include "/etc/bind/Kddns_key.+165+01234.private";)
3. Configure your “office.internal” zone for dynamic updates
Append to /etc/bind/named.conf.local:
zone "office.internal" {
type master;
file "/etc/bind/db.office.internal";
allow-update { key "ddns_key"; };
// or use the finer-grained update-policy style:
// update-policy { grant ddns_key name *.office.internal A; };
};
Create the initial zone‐file /etc/bind/db.office.internal:
$TTL 1h
@ IN SOA ns1.office.internal. hostmaster.office.internal. (
2024061501 ; serial
1h ; refresh
15m ; retry
1w ; expire
1h ) ; minimum
IN NS ns1.office.internal.
ns1 IN A 192.168.1.10 ; your BIND9 box
4. Forward all other queries to dns.usc.edu
In /etc/bind/named.conf.options (or the global options { … } block), enable recursion + forwarders:
options {
directory "/var/cache/bind";
recursion yes;
allow-query { any; };
// forward every query we don’t authoritatively answer
forward only;
forwarders {
dns.usc.edu; // or its IP
};
};
5. Restart BIND9
systemctl restart bind9 # or: service named restart
6. Push dynamic updates from your clients
On each workstation you can run an nsupdate script at boot:
#!/bin/bash
SERVER=192.168.1.10
KEY="ddns_key"
nsupdate <<EOF
server $SERVER
zone office.internal
key $KEY
update delete $(hostname).office.internal A
update add $(hostname).office.internal 300 A $(hostname -I | awk '{print $1}')
send
EOF
You can drop that in /etc/cron.d/ddns-update or run it via a systemd‐oneshot unit.
How it works
- BIND is authoritative for
office.internal and has allow-update set to your TSIG key.
- It will dynamically munge the zonefile in
/etc/bind/db.office.internal whenever it receives a signed nsupdate.
- Anything you don’t resolve locally (i.e. outside
office.internal) gets forwarded to dns.usc.edu.
- No DHCP server is required on your BIND host.
Alternative: PowerDNS + SQLite
If you’d rather have a built-in web/API interface to add/remove records, you can swap in PowerDNS Authoritative:
- Install
pdns-server pdns-backend-sqlite3 pdns-backend-bind
- Configure
/etc/powerdns/pdns.conf with a small SQLite DB
- Use
pdnsutil or the HTTP API to add/delete records under the office.internal zone
- Set
forward-zones=.=dns.usc.edu for forwarding
It’s a little heavier, but gives you a REST endpoint instead of rolling your own nsupdate scripts.
That’s it!
With BIND9’s TSIG-secured dynamic updates you get local DDNS without any DHCP, plus transparent forwarding of everything else upstream.