Can't get rcode statics by zone from statistics-channel.
Summary
Can't get rcode statics by zone from statistics-channel.
(Summarize the bug encountered concisely.)
BIND version used
BIND 9.11.31 (Extended Support Version) id:ac3f4eb
Steps to reproduce
$ dig @localhost example.jp TXT
$ curl http://localhost:10053/json/v1 | jq '.views._default.zones '
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 611k 100 611k 0 0 2282k 0 --:--:-- --:--:-- --:--:-- 2274k
[
{
"name": "example.jp",
"class": "IN",
"type": "slave",
"rcodes": {
"QrySuccess": 1,
"QryAuthAns": 1,
"QryUDP": 1
},
"qtypes": {
"TXT": 1
}
},
What is the current bug behavior?
- Key is "rcodes", but returned nsstats.
What is the expected correct behavior?
- Rcode counter value is assigned to "rcodes".
{
"name": "example.jp",
"class": "IN",
"type": "slave",
"rcodes": {
"QUERY": 1,
"IQUERY": 0,
"STATUS": 0,
"RESERVED3": 0,
"NOTIFY": 0,
"UPDATE": 0,
"RESERVED6": 0,
"RESERVED7": 0,
"RESERVED8": 0,
"RESERVED9": 0,
"RESERVED10": 0,
"RESERVED11": 0,
"RESERVED12": 0,
"RESERVED13": 0,
"RESERVED14": 0,
"RESERVED15": 0
},
"qtypes": {
"TXT": 1
}
Relevant configuration files
controls {
inet 127.0.0.1 port 953 allow {
127.0.0.1/32;
} keys {
"rndc-key";
};
};
options {
directory "/etc/named";
interface-interval 0;
listen-on {
"any";
};
listen-on-v6 {
"any";
};
querylog no;
check-names slave warn;
recursion no;
allow-query {
"any";
};
masterfile-format text;
multi-master yes;
notify explicit;
zone-statistics yes;
};
statistics-channels {
inet 127.0.0.1 port 10053 allow {
127.0.0.1/32;
};
};
key "rndc-key" {
algorithm "hmac-sha256";
secret "????????????????????????????????????????????";
};
zone "example.jp" {
type master;
file "example.jp";
};
Relevant logs and/or screenshots
/ # dig @localhost example.jp A
; <<>> DiG 9.16.15 <<>> @localhost example.jp A
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35022
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
; COOKIE: 3c4dff88f795ae6aa18c4f6f60ab43d66d51e96071fb1f12 (good)
;; QUESTION SECTION:
;example.jp. IN A
;; ANSWER SECTION:
example.jp. 3600 IN A 127.0.0.1
;; AUTHORITY SECTION:
example.jp. 3600 IN NS localhost.
;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon May 24 06:12:38 UTC 2021
;; MSG SIZE rcvd: 106
/ # curl http://localhost:10053/json/v1/zones
{
"json-stats-version":"1.2",
"boot-time":"2021-05-24T06:09:57.895Z",
"config-time":"2021-05-24T06:12:21.187Z",
"current-time":"2021-05-24T06:12:42.304Z",
"version":"9.11.31",
"views":{
"_default":{
"zones":[
{
"name":"example.jp",
"class":"IN",
"serial":0,
"type":"master",
"rcodes":{
"QrySuccess":1,
"QryAuthAns":1,
"QryUDP":1
},
"qtypes":{
"A":1
}
}
]
},
"_bind":{
"zones":[
{
"name":"authors.bind",
"class":"CH",
"serial":0,
"type":"builtin"
},
{
"name":"hostname.bind",
"class":"CH",
"serial":0,
"type":"builtin"
},
{
"name":"version.bind",
"class":"CH",
"serial":0,
"type":"builtin"
},
{
"name":"id.server",
"class":"CH",
"serial":0,
"type":"builtin"
}
]
}
}
}
### Possible fixes
(If you can, link to the line of code that might be responsible for the
problem.)