# dns\_query module shows response as a 0 rather than 1

**URL:** <https://community.netdata.cloud/t/dns-query-module-shows-response-as-a-0-rather-than-1/3664>\
**Category:** Help\
**Tags:** agent, collectors\
**Created:** [December 21, 2022, 11:40pm UTC](https://community.netdata.cloud/t/dns-query-module-shows-response-as-a-0-rather-than-1/3664 "2022-12-21T23:40:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luis\_Johnstone](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/luis_johnstone/32/151_2.png) [@Luis\_Johnstone](https://community.netdata.cloud/u/Luis_Johnstone)\
**Post date:** [December 21, 2022, 11:40pm UTC](https://community.netdata.cloud/t/dns-query-module-shows-response-as-a-0-rather-than-1/3664/1 "2022-12-21T23:40:00Z")

</div>

Just a quick one: I’ve setup the DNS latency collector as per:

> **[How to monitor DNS query response time | Netdata Blog](https://blog.netdata.cloud/dns-query-response-time/)**
>
> How to monitor DNS query response time

The chart for latency looks OK but the one for query status shows all as returning a value of ‘0’. This seems count-intuitive to me; is there any good reason why it’s a 0 instead of a 1? 🙂

---

<div class="post-metadata">

**Author:** ![ilyam8](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/ilyam8/32/134_2.png) [@ilyam8](https://community.netdata.cloud/u/ilyam8)\
**Post date:** [December 22, 2022, 8:54am UTC](https://community.netdata.cloud/t/dns-query-module-shows-response-as-a-0-rather-than-1/3664/2 "2022-12-22T08:54:17Z")

</div>

Hi, @Luis_Johnstone. The [query\_status chart](https://github.com/netdata/go.d.plugin/tree/master/modules/dnsquery#metrics) has 3 dimensions: success, network\_error, dns\_error.

- Each of them represents a state.
- The values can be 0 or 1.
- 0 means not in the state.
- 1 means in the state.
- [Only one of them can be 1](https://github.com/netdata/go.d.plugin/blob/0181398426da29fa2abe6848018bb776b6955d52/modules/dnsquery/collect.go#L43-L56) (active) at a time (read as “the current state is …”).

---

<div class="post-metadata">

**Author:** ![Luis\_Johnstone](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/luis_johnstone/32/151_2.png) [@Luis\_Johnstone](https://community.netdata.cloud/u/Luis_Johnstone)\
**Post date:** [December 22, 2022, 2:04pm UTC](https://community.netdata.cloud/t/dns-query-module-shows-response-as-a-0-rather-than-1/3664/3 "2022-12-22T14:04:52Z")

</div>

Ah, I see; it’s because you need any of the other 3 dimensions of the chart to also be able to be a 1 to indicate a problem (e.g. it wouldn’t make sense if network\_error = 1 meant everything was OK). I figured that it was something like that. Thanks!!

---

<div class="post-metadata">

**Author:** ![ilyam8](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/ilyam8/32/134_2.png) [@ilyam8](https://community.netdata.cloud/u/ilyam8)\
**Post date:** [December 22, 2022, 4:18pm UTC](https://community.netdata.cloud/t/dns-query-module-shows-response-as-a-0-rather-than-1/3664/4 "2022-12-22T16:18:34Z")

</div>

It is like this @Luis\_Johnstonebecause because aggregation over time is meaningful.

For instance, you get an average value for every state for the last 30 minutes and they are:

- success: 0.7
- network\_error: 0.2
- dns\_error: 0.1

This means that in the last 30 minutes, the percentage of successful requests is 70%, and so on.
