summaryrefslogtreecommitdiff
path: root/usr.sbin/nsd/query.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/nsd/query.c')
-rw-r--r--usr.sbin/nsd/query.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/nsd/query.c b/usr.sbin/nsd/query.c
index 09532677e2f..d5afe789cf0 100644
--- a/usr.sbin/nsd/query.c
+++ b/usr.sbin/nsd/query.c
@@ -1137,8 +1137,15 @@ answer_lookup_zone(struct nsd *nsd, struct query *q, answer_type *answer,
size_t domain_number, int exact, domain_type *closest_match,
domain_type *closest_encloser, const dname_type *qname)
{
- q->zone = domain_find_zone(closest_encloser);
+ q->zone = domain_find_zone(nsd->db, closest_encloser);
if (!q->zone) {
+ /* no zone for this */
+ if(q->cname_count == 0)
+ RCODE_SET(q->packet, RCODE_REFUSE);
+ return;
+ }
+ if(!q->zone->apex || !q->zone->soa_rrset) {
+ /* zone is configured but not loaded */
if(q->cname_count == 0)
RCODE_SET(q->packet, RCODE_SERVFAIL);
return;