INTEGRITY Cloudflare Docs

Analytics and logs

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


Analytics

DNS analytics allow you to evaluate data about DNS queries to your zone.

You can use the dashboard to get insights quickly based on a predefined set of dimensions, or use 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

Free Pro Business Enterprise
Availability Yes Yes Yes Yes
Maximum time interval (zone) 7 days 31 days 31 days 62 days
Maximum time interval (account) 7 days 7 days 7 days 62 days
Historical data (zone) 8 days 31 days 31 days 62 days
Historical data (account) 8 days 8 days 8 days 62 days

View on the dashboard

For a quick summary, view your DNS analytics on the dashboard:

Go to Analytics ↗

The DNS analytics dashboard contains four main panels. The filters and time frame that you specify at the top of the page apply to all of them.

Available dimensions

Panels

Explore with the API

For more detailed metrics, use the GraphQL API. Refer to the GraphQL Analytics API documentation for guidance on how to get started.

The DNS analytics has two schemas:

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

Get the last 10,000 queries resulting in NXDOMAIN

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
      }
    }
  }
}

Get the overall query count per account

query GetTotalDNSQueryCount {
  viewer {
    accounts(filter: { accountTag: "83a4527361bcdec24566fd7f837b6de5" }) {
      dnsAnalyticsAdaptiveGroups(
        filter: {
          date_geq: "2025-05-01"
          date_leq: "2025-05-30"
        }
        limit: 1
      ) {
        count
      }
    }
  }
}

Logs

Logs let Enterprise customers view detailed information about individual DNS queries.

For help setting up Logpush, refer to Logpush documentation.