At ESnet, our Zeek deployment was logging 4.2 million weirds per day. When we investigated, 90% were DNS-related and 98% of those came from a single opcode. After submitting a PR to fix it, daily weirds dropped to 1.3 million. Here’s how we tracked it down.

What is weird.log?

One of the most interesting log files that Zeek produces is weird.log. It captures protocol-level anomalies;  basically, whenever there’s something unexpected at the protocol level, that’s a weird. “Weirds” are hardcoded by whoever wrote the analyzer. They can also be generated by scripts, but that’s rare.

In simpler terms: any protocol traffic not complying with RFC standards, or any unknown traffic that isn’t parsed by Zeek, is flagged as weird.

If you run Zeek, you have encountered weird.log. The specific weirds you see depend on what traffic your deployment monitors–which is why your weird.log probably looks different from examples in blog posts or conference talks.

Our Zeek deployment monitors datacenter traffic: it can see east-west (internal hosts traffic) as well as north-south traffic (local-to-internet traffic). Here is the breakdown of some of the popular DNS-related weirds during a 24hrs window on a weekday that we see getting triggered in our log file:

Name Count Percent
DNS_unknown_opcode
3,040,986 90.707143
DNS_truncated_len_lt_hdr_len
197,905 5.903150
DNS_truncated_RR_rdlength_lt_len
47,324 1.411590
DNS_Conn_count_too_large
25,215 0.752118
DNS_truncated_quest_too_short
24,176 0.721127

Breaking down the pattern

90% of the DNS-related weirds were unknown opcode parsing errors. Breaking that down further, we tried to find out the largest portion of that 90%:

Name Addl Count Percent
DNS_unknown_opcode
4 3,000,476 98.667866
DNS_unknown_opcode
6 5,186 0.170537
DNS_unknown_opcode
12 5,003 0.164519
DNS_unknown_opcode
2 3,608 0.118646
DNS_unknown_opcode
13 3,542 0.116475

For all the DNS unknown opcodes recorded, it turns out the opcode=4, which is for DNS Notify messages, was constituting the 98% of the “DNS_unknown_opcode” weirds. 

What is DNS NOTIFY?

DNS NOTIFY (defined in RFC 1996 and RFC 8765) enables a primary DNS server to immediately inform secondary (slave) servers of changes to zone data. This alert triggers a zone transfer that ensures the secondary servers’ data remains synchronized with the primary. The recording of numerous messages in our weird.log file made sense: our Zeek sensors monitor internal traffic, which includes communication between our DNS servers. When you have Zeek monitoring only north-south traffic, you miss these internal DNS notifications. Given our vantage point for Zeek, it was prudent to solve this alert, as it was triggering millions of DNS NOTIFY message alerts every day.

The Quick Fix

Since Zeek already supports standard query/response (opcode 0) parsing in DNS messages, NOTIFY messages can be treated indifferently to be supported built-in without any additional parsing code. The fix is straightforward: enable opcode 4 and don’t exclude it from the packets parsing src code in DNS.cc file. We submitted a PR to enable standard QR parsing for DNS NOTIFY messages and avoid the flood of “DNS_unknown_opcode (4)” in the zeek weird.log file, which is merged into the master and should be available in the next minor release.

The Results

After updating our datacenter cluster to Zeek 8.2.0-dev.534 (which includes this fix), we immediately saw a decline in DNS-based weirds from 90% to 13% of total DNS-related weirds:

Name Count Percent
DNS_truncated_len_lt_hdr_len
194,331 66.371690
DNS_unknown_opcode
38,698 13.216891
DNS_truncated_RR_rdlength_lt_len
26,021 8.887196
DNS_Conn_count_too_large
21,636 7.389546
DNS_truncated_quest_too_short
4,270 1.458373

Overall weird alerts dropped from ~4.2M/day to ~1.3M/day. The graph below shows the decrease in weird count split by “name” field”, where y-axis is showing the total number of each type of “name” (weird) recorded over 10 days (04/06/26-04/16/26):

Takeaway

If one weird is triggering millions of times in your environment, investigate it. In our case, fixing one opcode reduced our daily weird count by 70% and saved us on SIEM ingestion costs. 

Check your weird.log and sort by count. If one weird dominates, dig into what’s triggering it. You might find a simple fix that cleans up your logs.

Author

Discover more from Zeek

Subscribe now to keep reading and get access to the full archive.

Continue reading