i've been trying to set up a domain that can be updated. i'm using bind9, i've used
ddns-confgen -a hmac-sha512 -k <keyname>
to generate my key, i've added the key in /etc/bind/keys.local
key "<keyname>" {
algorithm hmac-sha512;
secret "<secret>";
};
my named.conf file looks like this:
include "/etc/bind/keys.local";
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
my named.conf.local file looks like this:
zone "<subdomain_name>" {
type master;
update-policy {
grant <keyname> zonesub ANY;
};
file "<zone_file>"; # zone file path
};
zone "<reverse_zone>.in-addr.arpa" {
type master;
update-policy {
grant <keyname> zonesub ANY;
};
file "<reverse_zone_file>";
};
am i missing something obvious? because when i do:
sudo nsupdate -k <keyfile>
server <dns_server>
zone <subdomain_name>
update add newhost.<subdomain_name> 86400 A <newhost_ip>
send
i end up getting a SERVFAIL response...
dig <dns_server>
and
ping <dns_server>
work correctly, i just cannot get DDNS to work. i've tried responses in other threads like this one, all end up giving me SERVFAIL regardless of what i try. thanks in advance for any suggestions.
edit1: this is the corresponding logs on the server-side when i attempt an nsupdate:
signer "<keyname>" approved
apparmor="DENIED" operation="mknod" profile="/usr/sbin/named" name="/etc/bind/zones/<zone_file>" pid=18799 comm="named" requested_mask="c" denied_mask="c" fsuid=112 ouid=112
client <client_ip>#62287/key <keyname>: signer "<keyname>" approved
client 172.30.2.253#62287/key <keyname>: updating zone '<zonename>/IN': adding an RR at 'host3.<zonename>' A <new_host_ip>
/etc/bind/zones/<zone_file>: create: permission denied
client <client_ip>#62287/key <keyname>: updating zone 'aci.riviera.local/IN': error: journal open failed: unexpected error
edit2:
turns out bind group did not have write permissions on /etc/bind ...
sudo chown -R bind:bind /etc/bind
fixed the problem