Skip to content

Commit

Permalink
Avoid PTR updates to root servers
Browse files Browse the repository at this point in the history
Unless explicitly allowed by the UpdateTopLevelDomainZones option.
  • Loading branch information
tedjp committed May 3, 2012
1 parent f9655f2 commit 9ca1f3e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dnsupdate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,11 @@ static int addr_to_ptr(const struct addr *addr, char *str, size_t len)
return addr_to_ptr_v4(&addr->u.inaddr, str, len);
}

static int is_reverse_tld(const char *name) {
return( strcasecmp(name, "ip6.arpa") == 0
|| strcasecmp(name, "in-addr.arpa") == 0);
}

int
main(int argc, char **argv)
{
Expand Down Expand Up @@ -1489,7 +1494,7 @@ main(int argc, char **argv)
*auth_domain ? auth_domain : "(root)");

/* Check for non FQDNs and top-level domain names */
if (count_dots(auth_domain) < 1) {
if (count_dots(auth_domain) < 1 || is_reverse_tld(auth_domain)) {
if (verbose)
warnx("auth domain '%.255s' is top-level", auth_domain);

Expand Down

0 comments on commit 9ca1f3e

Please sign in to comment.