diff --git a/subprocessors/dnsreader.go b/subprocessors/dnsreader.go index 0db4e52f..81beacd5 100644 --- a/subprocessors/dnsreader.go +++ b/subprocessors/dnsreader.go @@ -125,6 +125,14 @@ func (d *DnsProcessor) Run(sendTo []chan dnsutils.DnsMessage) { dm.DNS.Rcode = dnsutils.RcodeToString(dnsHeader.Rcode) dm.DNS.Opcode = dnsHeader.Opcode + // update dnstap operation if the opcode is equal to 5 (dns update) + if dm.DNS.Opcode == 5 && dnsHeader.Qr == 1 { + dm.DnsTap.Operation = "UPDATE_QUERY" + } + if dm.DNS.Opcode == 5 && dnsHeader.Qr == 0 { + dm.DnsTap.Operation = "UPDATE_RESPONSE" + } + if dnsHeader.Qr == 1 { dm.DNS.Flags.QR = true } diff --git a/subprocessors/dnstapreader.go b/subprocessors/dnstapreader.go index 82593173..edffbb59 100644 --- a/subprocessors/dnstapreader.go +++ b/subprocessors/dnstapreader.go @@ -217,6 +217,15 @@ func (d *DnstapProcessor) Run(sendTo []chan dnsutils.DnsMessage) { dm.DNS.Rcode = dnsutils.RcodeToString(dnsHeader.Rcode) dm.DNS.Opcode = dnsHeader.Opcode + // update dnstap operation if the opcode is equal to 5 (dns update) + if dm.DNS.Opcode == 5 && op%2 == 1 { + dm.DnsTap.Operation = "UPDATE_QUERY" + } + if dm.DNS.Opcode == 5 && op%2 == 1 { + dm.DnsTap.Operation = "UPDATE_RESPONSE" + } + + // set dns flags if dnsHeader.Qr == 1 { dm.DNS.Flags.QR = true }