# Monitoring DNS

Chart and alarm on the queries each hosted zone gets, and see a zone's delegation and DNSSEC state.

## Query metrics

Every platform nameserver counts the queries it answers for each of your zones, by response code,
and reports them every minute. You get them as a metric whether or not query logging is on.

| Namespace | Metric    | Unit  | Dimensions                                  |
| --------- | --------- | ----- | ------------------------------------------- |
| `EWS/DNS` | `Queries` | Count | `HostedZone`; and `HostedZone` with `Rcode` |

`Rcode` is the response code: mostly `NOERROR` and `NXDOMAIN`, `SERVFAIL` when a nameserver could
not answer. Queries for names in none of your zones are refused and not counted, so `REFUSED` does
not appear.

Chart the metric under **Monitoring**, **Metrics** (the zone's **Query log** tab links there, as
**Monitoring → Metrics → EWS/DNS**), or put an alarm on it. A jump in `NXDOMAIN` points at a
misconfigured client, or at someone asking for random names under your zone. In a signed zone, a
resolver that asks with DNSSEC gets `NOERROR` for a name that does not exist (compact denial, see
[How the nameservers answer](how-the-nameservers-answer.md)), unless it sets the `CO` flag, so such
answers are counted as `NOERROR`.

## Query log

For the queries themselves, turn on the zone's query log (see [Log a zone's queries](log-queries.md)).

## Delegation and DNSSEC state

The zone list shows each zone's **Delegation** status and when it was **Last checked**; the zone's
header shows **DNSSEC** and **Query logging**. The delegation status is what the last check found
(see [Delegate a domain](delegate-a-domain.md)); whether a signed zone validates is on its
**DNSSEC** tab, under **Chain of trust** (see [Sign a zone with DNSSEC](sign-a-zone-with-dnssec.md)).

## Related

- [How the nameservers answer](how-the-nameservers-answer.md)
- [Troubleshooting](troubleshooting.md)
