--synth-domain now works in auth mode.

This commit is contained in:
Simon Kelley
2021-07-19 00:10:49 +01:00
parent adf9dec1e6
commit c068b3ae2f
3 changed files with 29 additions and 0 deletions

View File

@@ -79,6 +79,9 @@ version 2.86
Allow smaller then 64 prefix lengths in synth-domain, with caveats.
--synth-domain=1234:4567::/56,example.com is now valid.
Make domains generated by --synth-domain appear in replies
when in authoritative mode.
version 2.85
Fix problem with DNS retries in 2.83/2.84.

View File

@@ -2419,6 +2419,10 @@ following data is used to populate the authoritative zone.
.B --mx-host, --srv-host, --dns-rr, --txt-record, --naptr-record, --caa-record,
as long as the record names are in the authoritative domain.
.PP
.B --synth-domain
as long as the domain is in the authoritative zone and, for
reverse (PTR) queries, the address is in the relevant subnet.
.PP
.B --cname
as long as the record name is in the authoritative domain. If the
target of the CNAME is unqualified, then it is qualified with the

View File

@@ -253,6 +253,17 @@ size_t answer_auth(struct dns_header *header, char *limit, size_t qlen, time_t n
} while ((crecp = cache_find_by_addr(crecp, &addr, now, flag)));
if (!found && is_rev_synth(flag, &addr, name) && (local_query || in_zone(zone, name, NULL)))
{
log_query(F_CONFIG | F_REVERSE | flag, name, &addr, NULL);
found = 1;
if (add_resource_record(header, limit, &trunc, nameoffset, &ansp,
daemon->auth_ttl, NULL,
T_PTR, C_IN, "d", name))
anscount++;
}
if (found)
nxdomain = 0;
else
@@ -401,6 +412,17 @@ size_t answer_auth(struct dns_header *header, char *limit, size_t qlen, time_t n
}
}
if (!found && is_name_synthetic(flag, name, &addr) )
{
found = 1;
nxdomain = 0;
log_query(F_FORWARD | F_CONFIG | flag, name, &addr, NULL);
if (add_resource_record(header, limit, &trunc, nameoffset, &ansp,
daemon->auth_ttl, NULL, qtype, C_IN, qtype == T_A ? "4" : "6", &addr))
anscount++;
}
if (!cut)
{
nxdomain = 0;