We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 830edae commit 4a553baCopy full SHA for 4a553ba
dns.go
@@ -7,6 +7,8 @@ import (
7
"errors"
8
"fmt"
9
"log"
10
+ "os"
11
+ "strings"
12
"time"
13
14
"github.com/cilium/ebpf/ringbuf"
@@ -65,6 +67,16 @@ func processUDPPackets(ctx context.Context, reader *ringbuf.Reader) {
65
67
continue // Skip HINFO queries
66
68
}
69
70
+ // Skip DNS queries for the current hostname
71
+ if len(dnsLayer.Questions) > 0 {
72
+ queryName := strings.TrimSuffix(string(dnsLayer.Questions[0].Name), ".")
73
+ if hostname, err := os.Hostname(); err == nil {
74
+ if strings.EqualFold(queryName, hostname) {
75
+ continue // Skip queries for current hostname
76
+ }
77
78
79
+
80
entry := statEntry{
81
SrcPort: udpPktDetails.SrcPort,
82
SrcIP: bytesToAddr(udpPktDetails.Srcip.In6U.U6Addr8),
0 commit comments