From c6e09dd5a51e73c8e250a7cd31440d6ef795b686 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Wed, 6 Jan 2021 03:20:31 +0100 Subject: [PATCH] Don't except Delegation on origin --- services/abstract/delegation.go | 4 ++++ services/analyzer.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/services/abstract/delegation.go b/services/abstract/delegation.go index 52ff71e..aef8964 100644 --- a/services/abstract/delegation.go +++ b/services/abstract/delegation.go @@ -92,6 +92,10 @@ func delegation_analyze(a *svcs.Analyzer) error { delegations := map[string]*Delegation{} for _, record := range a.SearchRR(svcs.AnalyzerRecordFilter{Type: dns.TypeNS}) { + if record.Header().Name == a.GetOrigin() { + continue + } + if ns, ok := record.(*dns.NS); ok { if _, ok := delegations[ns.Header().Name]; !ok { delegations[ns.Header().Name] = &Delegation{} diff --git a/services/analyzer.go b/services/analyzer.go index 688d506..31db6e2 100644 --- a/services/analyzer.go +++ b/services/analyzer.go @@ -51,6 +51,10 @@ type Analyzer struct { defaultTTL uint32 } +func (a *Analyzer) GetOrigin() string { + return a.origin +} + type AnalyzerRecordFilter struct { Prefix string Domain string