Shouldn't it be:

    hosts_domain_keyfile="${CONF_HOSTS_DOMAIN_KEYFILE:-/var/named/${hosts_domain}.key}"

Just in case someone wants to configure that for some crazy reason? Otherwise why describe it in the conf?