---
title: "DNS check | Grafana Cloud documentation"
description: "DNS check DNS or domain name servers resolve a domain to an IP address. This check ensures a domain resolves and measures the average time for the resolution to happen. DNS checks can be set up to validate against a specific DNS server and check for a specific kind of response. Behind the scenes, DNS checks work by sending automated requests to DNS servers and validating the results for specific domain names, checking that domains return the correct IP addresses in their A records, AAAA records, or other DNS record types."
---

# DNS check

DNS or domain name servers resolve a domain to an IP address. This check ensures a domain resolves and measures the average time for the resolution to happen. DNS checks can be set up to validate against a specific DNS server and check for a specific kind of response. Behind the scenes, DNS checks work by sending automated requests to DNS servers and validating the results for specific domain names, checking that domains return the correct IP addresses in their A records, AAAA records, or other DNS record types.

## Create a DNS check

You can create and execute a DNS check from the Synthetic Monitoring UI.

1. On the left-side menu, select **Testing &amp; synthetics** &gt; **Synthetics**.
2. Click **Create new check** or **Add new check**.
3. Choose **API Endpoint** as your check type.
4. Set the value for the required [options](#options).
5. Schedule or run the check.
   
   1. Click **Save** to schedule the check.
   2. Click **Test** to run the DNS check.

## Options

The list of common options to all check types:

Expand table

| Option          | Description                                                                                                                                                                             |
|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Enabled         | Whether the check is enabled or not.                                                                                                                                                    |
| Job name        | Refer to the check name. Check metrics include a `job` label with the value of this option.                                                                                             |
| Target          | Target of the check request. Check metrics include an `instance` label with the value of this option.                                                                                   |
| Probe locations | The locations where the check should run from. Check metrics include a `probe` label with the value of the probe location running the check.                                            |
| Frequency       | The frequency the check should run in seconds. The value can range from 10 to 3600 seconds. Only the `sm_check_info` metric includes the `frequency` label.                             |
| Timeout         | Maximum execution time for the check. The value can range from 1 to 60 seconds.                                                                                                         |
| Custom labels   | (Optional) Custom labels applied to check metrics. Refer to [Custom labels](/docs/grafana-cloud/testing/synthetic-monitoring/analyze-results/custom-labels/) for querying instructions. |

Additionally, DNS checks have the following options:

Expand table

| Option                      | Description                                                                                                                                                                                                                                                                |
|-----------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Record type                 | The resource record to query.                                                                                                                                                                                                                                              |
| Server                      | The nameserver to query.                                                                                                                                                                                                                                                   |
| Port                        | The port used to connect to the server.                                                                                                                                                                                                                                    |
| Protocol                    | The protocol (TCP, UDP) used to connect to the server.                                                                                                                                                                                                                     |
| Valid response codes        | The set of response codes to accept.                                                                                                                                                                                                                                       |
| Valid response matches      | A series of validations to apply to the response.                                                                                                                                                                                                                          |
| IP version                  | The IP version to use: `V4` (IPv4 only), `V6` (IPv6 only), or `Any` (prefers IPv6, falls back to IPv4). With `Any`, if no IPv6 (AAAA) record exists, the check uses IPv4 (A) records. The check doesn’t retry with a different IP version if the initial connection fails. |
| Publish full set of metrics | Whether to publish additional metrics to create histograms (used for Apdex scores or heatmaps). Default is false to reduce the number of active series.                                                                                                                    |

These last options don’t produce any [additional labels in the resulting check metrics](/docs/grafana-cloud/testing/synthetic-monitoring/create-checks/checks/#metric-labels).

## Metrics

Checks store their results as Prometheus metrics, including the list of common metrics:

Expand table

| Metric                       | Description                                                         |
|------------------------------|---------------------------------------------------------------------|
| `probe_all_duration_seconds` | Returns how long the probe took to complete in seconds (histogram). |
| `probe_duration_seconds`     | Returns how long the probe took to complete in seconds.             |
| `probe_all_success`          | Displays whether or not the probe was a success (summary).          |
| `probe_success`              | Displays whether or not the probe was a success.                    |
| `sm_check_info`              | Provides information about a single check configuration.            |

Additionally, DNS checks produce the following metrics:

Expand table

| Metric                          | Description                                                                            |
|---------------------------------|----------------------------------------------------------------------------------------|
| `probe_dns_additional_rrs`      | Returns the number of entries in the additional resource record list.                  |
| `probe_dns_answer_rrs`          | Returns the number of entries in the answer resource record list.                      |
| `probe_dns_authority_rrs`       | Returns the number of entries in the authority resource record list.                   |
| `probe_dns_duration_seconds`    | Duration of DNS request by phase.                                                      |
| `probe_dns_lookup_time_seconds` | Returns the time taken for probe DNS lookup in seconds.                                |
| `probe_dns_query_succeeded`     | Displays whether or not the query was executed successfully.                           |
| `probe_ip_addr_hash`            | Specifies the hash of the IP address. It’s useful to detect if the IP address changes. |
| `probe_ip_protocol`             | Specifies whether probe IP protocol is IP4 or IP6.                                     |
