Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 54 additions & 2 deletions src/content/docs/dns/additional-options/analytics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar:

---

import { FeatureTable } from "~/components"
import { FeatureTable, Details } from "~/components"

When you use Cloudflare DNS, you can access data about DNS queries through a variety of sources.

Expand All @@ -18,6 +18,8 @@ DNS analytics allow you to evaluate data about DNS queries to your zone.

You can [use the dashboard](#view-on-the-dashboard) to get insights quickly based on a [predefined set of dimensions](#available-dimensions), or [use the API](#explore-with-the-api) to have access to all fields available in the GraphQL DNS analytics schemas.

When using GraphQL, you also have the option to get data for DNS queries across all zones within a given Cloudflare account.

### Availability and limits

<FeatureTable id="dns.dns_analytics" />
Expand Down Expand Up @@ -66,10 +68,60 @@ The DNS analytics has two [schemas](/analytics/graphql-api/getting-started/query
* `dnsAnalyticsAdaptive`: Retrieve information about individual DNS queries.
* `dnsAnalyticsAdaptiveGroups`: Get reports on aggregate information only.

To get account-level data, you can set up queries similar to the following:

<Details header="Get the last 10,000 queries resulting in NXDOMAIN" open = {true}>

```graphql graphql-api-explorer
query GetLastNXDOMAINResponses {
viewer {
accounts(filter: { accountTag: "83a4527361bcdec24566fd7f837b6de5" }) {
dnsAnalyticsAdaptive(
limit: 10000
filter: {
date_geq: "2025-06-16",
responseCode: "NXDOMAIN",
date_leq: "2025-06-18"
}
orderBy: [datetime_DESC]
) {
zoneTag
queryName
responseCode
queryType
datetime
}
}
}
}
```
</Details>

<Details header="Get the overall query count per account" open = {true}>

```graphql graphql-api-explorer
query GetTotalDNSQueryCount {
viewer {
accounts(filter: { accountTag: "83a4527361bcdec24566fd7f837b6de5" }) {
dnsAnalyticsAdaptiveGroups(
filter: {
date_geq: "2025-05-01"
date_leq: "2025-05-30"
}
limit: 1
) {
count
}
}
}
}
```
</Details>

---

## Logs

Logs let Enterprise customers view [detailed information](/logs/reference/log-fields/zone/dns_logs/) about individual DNS queries.

For help setting up Logpush, refer to [Get started with Logs](/logs/get-started/).
For help setting up Logpush, refer to [Get started with Logs](/logs/get-started/).
23 changes: 19 additions & 4 deletions src/content/plans/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -690,20 +690,35 @@
"biz": "Yes",
"ent": "Yes"
},
"maximum_duration": {
"title": "Maximum time interval",
"maximum_duration_zone": {
"title": "Maximum time interval (zone)",
"free": "7 days",
"pro": "31 days",
"biz": "31 days",
"ent": "62 days"
},
"historical_data": {
"title": "Historical data",
"maximum_duration_account": {
"title": "Maximum time interval (account)",
"free": "7 days",
"pro": "7 days",
"biz": "7 days",
"ent": "62 days"
},
"historical_data_zone": {
"title": "Historical data (zone)",
"free": "8 days",
"pro": "31 days",
"biz": "31 days",
"ent": "62 days"
},
"historical_data_account": {
"title": "Historical data (account)",
"free": "8 days",
"pro": "8 days",
"biz": "8 days",
"ent": "62 days"
}

}
},
"dnssec": {
Expand Down
Loading