I am running a recursive DNS resolver with unbound 1.9.0 on Debian Stretch. It periodically logs statistics about the recursion procession times. The latest is:
[2195:0] info: server stats for thread 0: 157732 queries, 87671 answers from cache, 70061 recursions, 0 prefetch, 0 rejected by ip ratelimiting
[2195:0] info: server stats for thread 0: requestlist max 145 avg 20.751 exceeded 0 jostled 0
[2195:0] info: average recursion processing time 0.014740 sec
[2195:0] info: histogram of recursion processing times
[2195:0] info: [25%]=0.0260698 median[50%]=0.0470106 [75%]=0.106954
[2195:0] info: lower(secs) upper(secs) recursions
[2195:0] info: 0.000000 0.000001 1792
[2195:0] info: 0.000256 0.000512 3
[2195:0] info: 0.000512 0.001024 71
[2195:0] info: 0.001024 0.002048 186
[2195:0] info: 0.002048 0.004096 490
[2195:0] info: 0.004096 0.008192 876
[2195:0] info: 0.008192 0.016384 2321
[2195:0] info: 0.016384 0.032768 19920
[2195:0] info: 0.032768 0.065536 21561
[2195:0] info: 0.065536 0.131072 8427
[2195:0] info: 0.131072 0.262144 8884
[2195:0] info: 0.262144 0.524288 3188
[2195:0] info: 0.524288 1.000000 1468
[2195:0] info: 1.000000 2.000000 493
[2195:0] info: 2.000000 4.000000 278
[2195:0] info: 4.000000 8.000000 70
[2195:0] info: 8.000000 16.000000 4
[2195:0] info: 16.000000 32.000000 18
[2195:0] info: 32.000000 64.000000 5
[2195:0] info: 64.000000 128.000000 4
[2195:0] info: 128.000000 256.000000 1
[2195:0] info: 256.000000 512.000000 1
Most processing times look file, but there are a few requests that took several seconds to process, up to a several minutes.
I’m curious about those requests and would like to investigate them. Is there any known way to do so? For example, I’d like it if I could ask Unbound to log any recursion that needed more than 4 seconds to process.