Make interface spec optional in --auth-server.

But make auth-server required when any auth-zones are defined.

The "glue record" field in auth-server is needed to synthesise
SOA and NS records in auth zones, so the --auth-server has to
be specified. If makes sense, however to define one or more
auth-zones that appear within the normal recursive DNS service
without actually acting as an authoritative DNS server on
any interface. Hence making the interface field optional.
This commit is contained in:
Simon Kelley
2018-10-05 16:34:35 +01:00
parent 7cbf497da4
commit 08933475ab
3 changed files with 44 additions and 39 deletions

View File

@@ -216,7 +216,7 @@ int main (int argc, char **argv)
#endif
#ifndef HAVE_AUTH
if (daemon->authserver || daemon->auth_zones)
if (daemon->auth_zones)
die(_("authoritative DNS not available: set HAVE_AUTH in src/config.h"), NULL, EC_BADCONF);
#endif
@@ -235,13 +235,20 @@ int main (int argc, char **argv)
now = dnsmasq_time();
/* Create a serial at startup if not configured. */
if (daemon->auth_zones && daemon->soa_sn == 0)
if (daemon->auth_zones)
{
if (!daemon->authserver)
die(_("--auth-server required when an auth zone is defined."), NULL, EC_BADCONF);
/* Create a serial at startup if not configured. */
#ifdef HAVE_BROKEN_RTC
die(_("zone serial must be configured in --auth-soa"), NULL, EC_BADCONF);
if (daemon_>soa_sn == 0)
die(_("zone serial must be configured in --auth-soa"), NULL, EC_BADCONF);
#else
daemon->soa_sn = now;
if (daemon->soa_sn == 0)
daemon->soa_sn = now;
#endif
}
#ifdef HAVE_DHCP6
if (daemon->dhcp6)