diff --git a/bin/named/geoip.c b/bin/named/geoip.c index 5e5d586986..f67960fed5 100644 --- a/bin/named/geoip.c +++ b/bin/named/geoip.c @@ -137,6 +137,4 @@ named_geoip_shutdown(void) { named_g_geoip->domain = NULL; } #endif /* HAVE_GEOIP2 */ - - dns_geoip_shutdown(); } diff --git a/bin/named/server.c b/bin/named/server.c index 990863149a..9321bc1dad 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -68,6 +68,7 @@ #include #include #include +#include #include #include #include @@ -8338,6 +8339,10 @@ load_configuration(const char *filename, named_server_t *server, isc_socketmgr_setreserved(named_g_socketmgr, reserved); #if defined(HAVE_GEOIP2) + /* + * Release any previously opened GeoIP2 databases. + */ + named_geoip_shutdown(); /* * Initialize GeoIP databases from the configured location. * This should happen before configuring any ACLs, so that we @@ -9742,6 +9747,7 @@ shutdown_server(isc_task_t *task, isc_event_t *event) { #endif #if defined(HAVE_GEOIP2) named_geoip_shutdown(); + dns_geoip_shutdown(); #endif /* HAVE_GEOIP2 */ dns_db_detach(&server->in_roothints);