Okay, given your requirements:
- Local DDNS server.
- Serves the
.office.internal zone authoritatively, handling DDNS updates.
- Does NOT serve DHCP.
- Forwards other requests (not
.office.internal) to an upstream server (dns.usc.edu).
- Lightweight and easy to configure.
- Not
dnsmasq.
Based on these constraints, CoreDNS is an excellent fit.
Why CoreDNS?
- Lightweight and Modular: Built with a plugin architecture, you only enable what you need.
- Easy Configuration: Uses a simple text-based
Corefile which is often more straightforward than BIND's named.conf for simpler setups.
- Supports DDNS: Has a dedicated
ddns plugin (RFC 2136).
- Supports Authoritative Zones: Uses the
file or other plugins to serve zones.
- Supports Forwarding: Has a
forward plugin that can conditionally forward queries.
- Independent of DHCP: CoreDNS is a DNS server, not a DHCP server.
Alternatives and why they might not be ideal for this specific case:
- BIND: Can absolutely do this. It supports DDNS, authoritative zones, and forwarding. However, its configuration files (
named.conf, zone files) are traditionally considered more complex than CoreDNS's Corefile, and it's often perceived as less "lightweight" than CoreDNS for basic setups (though very powerful for complex ones).
- Unbound: Primarily a recursive resolver. While excellent for caching, validation, and resolving, it is not designed to be an authoritative server that accepts DDNS updates from clients for a local zone.
- PowerDNS (Authoritative): Supports DDNS and authoritative zones. Can use various backends (including databases). It's a strong option, but for a simple file-backed setup, CoreDNS's configuration is often more direct. PowerDNS Recursor would handle the forwarding part, potentially requiring two components unless the Authoritative server's forwarding capabilities are sufficient (CoreDNS combines this easily).
Therefore, CoreDNS is the recommended choice.
How to Configure CoreDNS
Here's how you would configure CoreDNS to meet your requirements:
-
Installation:
- Download a pre-compiled binary for your server's OS from the CoreDNS releases page.
- Alternatively, use a package manager if available (
apt install coredns, yum install coredns, etc.).
- Or run it in Docker.
- Place the
coredns executable in a directory in your PATH (e.g., /usr/local/bin/).
-
Create the Configuration Directory and Files:
- Create a directory for CoreDNS configuration, e.g.,
/etc/coredns.
- Inside
/etc/coredns, create the main configuration file, conventionally named Corefile.
- Create a subdirectory for zone files, e.g.,
/etc/coredns/zones.
- Create an initial zone file for
office.internal, e.g., /etc/coredns/zones/db.office.internal. Ensure the user CoreDNS runs as has write permissions to this zone file.
-
Configure the Corefile:
Edit /etc/coredns/Corefile with the following content. Replace <your_server_ip> with the actual IP address of the server where CoreDNS is running (preferably a static IP on your local network interface, e.g., 192.168.1.1).
After setting this up and configuring clients, your workstations should start registering their IP addresses with the CoreDNS server for the .office.internal zone. Queries for .office.internal names will be resolved locally by CoreDNS using its managed zone file, and all other queries will be forwarded to dns.usc.edu (and the fallbacks).