COREDNS-ERRORS(7)

πŸ“¦
version 1.15.0 Β· 2 versions
, in nixpkgs unstable, opensuse-leap 16.0

πŸ’… COREDNS-ERRORS(7) β€” the errors plugin, explained by your fav Unix bestie

okay so welcome to the CoreDNS Plugins girlies, this one's called errors and it literally enables error logging. that's the whole vibe. let's get into it ✨


🌸 NAME

errors β€” enables error logging. yes bestie, that's it, that's the name πŸ’–


πŸ¦‹ DESCRIPTION

So the way that this works: any errors encountered during the query processing will be printed to standard output. like, all of them, out loud, to stdout, no filter πŸ™ˆ

But here's the iconic part β€” errors of a particular type can be consolidated and printed once per some period of time. so instead of getting spammed with the same error 400 times you get one cute little summary. main character energy fr fr πŸ‘‘

⚠️ heads up bestie: this plugin can only be used once per Server Block. one per block. don't be greedy. πŸ’€

✨ SYNTAX

The basic syntax is giving minimalist:

errors

Extra knobs are available with an expanded syntax (the glow-up version):

errors {
    stacktrace
    consolidate DURATION REGEXP [LEVEL] [show_first]
}

okay let's break down the options, because there's lore 🌈

  • stacktrace β€” this option will log a stacktrace during panic recovery. when things go πŸ’€, you get receipts.
  • consolidate DURATION REGEXP [LEVEL] [show_first] β€” allows collecting several error messages matching the regular expression REGEXP during DURATION. some deets:
    • REGEXP must not exceed 10000 characters. like, keep it reasonable babe.
    • After the DURATION since receiving the first such message, the consolidated message will be printed to standard output with log level, which is configurable by the optional option LEVEL.
    • Supported options for LEVEL: warning, error, info and debug. that's the whole menu πŸ“

and it looks like this when it fires:

2 errors like '^read udp .* i/o timeout$' occurred in last 30s

Now the show_first flag β€” this one's lowkey the best feature 🫢 if the optional show_first flag is specified, the first error will be logged immediately when it occurs, and then subsequent matching errors will be consolidated. When the consolidation period ends:

  • If only one error occurred, no summary is printed (since it was already logged) β€” no dupe, we respect the dupe rules.
  • If multiple errors occurred, a summary is printed showing the total count.

Example with 3 errors (look at her go):

[WARNING] 2 example.org. A: read udp 10.0.0.1:53->8.8.8.8:53: i/o timeout
[WARNING] 3 errors like '^read udp .* i/o timeout$' occurred in last 30s

Example with 1 error (she said "no summary needed"):

[WARNING] 2 example.org. A: read udp 10.0.0.1:53->8.8.8.8:53: i/o timeout

Multiple consolidate options with different DURATION and REGEXP are allowed πŸ‘―β€β™€οΈ In case if some error message corresponds to several defined regular expressions, the message will be associated with the first appropriate REGEXP. first come first served, that's the rule.

For better performance, it's recommended to use the ^ or $ metacharacters in regular expression when filtering error messages by prefix or suffix, e.g. ^failed to .*, or .* timeout$. performance slay πŸ’… do it. iykyk.


πŸŽ€ EXAMPLES

Example one β€” use the whoami to respond to queries in the example.org domain and Log errors to standard output:

example.org {
    whoami
    errors
}

Example two β€” use the forward plugin to resolve queries via 8.8.8.8 and print consolidated messages for errors with suffix " i/o timeout" as warnings, and errors with prefix "Failed to " as errors:

. {
    forward . 8.8.8.8
    errors {
        consolidate 5m ".* i/o timeout$" warning
        consolidate 30s "^Failed to .+"
    }
}

Example three β€” use the forward plugin and consolidate timeout errors with show_first option to see both the summary and the first occurrence of the error:

. {
    forward . 8.8.8.8
    errors {
        consolidate 5m ".* i/o timeout$" warning show_first
        consolidate 30s "^Failed to .+" error show_first
    }
}

🌈 sign-off

that's the whole page bestie, no cap 🧚 this one's from the CoreDNS girlies, March 2026, manual page COREDNS-ERRORS(7) β€” go forth and log those errors, periodt πŸ’œπŸ”₯

πŸ“¦ where this page comes from