How do you setup a DNS server in order to be able to add records on-the-fly?
Solution 1:
If all the records you will be adding are a sub-domain of a specific zone, then you could easily setup bind for dynamic updates. Then simply use nsupdate to submit an update to the zone.
This should work fine, if all the new records are records within an existing domain. If you need to dynamically add other domains, then this won't really help.
// zone config
// using ip only for authentication, should really use hmac auth
zone "example.com" {
type master;
file "/etc/bind/dyn/example.com.dns";
allow-query {any;};
allow-update {
127.0.0.1;
192.0.2.0/24;
};
};
Update script using nsupdate.
#!/bin/bash
record=yyy.example.com
(
echo "server xx1.example.com"
echo "zone example.com"
echo "update delete ${record} A"
echo "update add ${record} ${ttl} A 192.0.2.1"
echo "send"
) | /usr/bin/nsupdate
Solution 2:
I use myDNS It works great and is simple, it also can work with BIND easily. There are other ones out there like PowerDNS and others.
Solution 3:
bind
is able to (re-) load files for single domains without restarting in whole.