diff --git a/modules/s_dns_resolver.cc b/modules/s_dns_resolver.cc index 8189a206a..b88c45404 100644 --- a/modules/s_dns_resolver.cc +++ b/modules/s_dns_resolver.cc @@ -86,7 +86,15 @@ ircd::net::dns::resolver_call(const hostport &hp, host(hp) }; - (*resolver)(hp, opts, std::move(cb)); + auto &resolver{*dns::resolver}; + if(unlikely(!resolver.ns.is_open())) + throw error + { + "Cannot resolve '%s': resolver is closed.", + host(hp) + }; + + resolver(hp, opts, std::move(cb)); } //