Documentation

DNS Query Input Plugin

This plugin gathers information about DNS queries such as response time and result codes.

Introduced in: Telegraf v1.4.0 Tags: system, network OS support: all

Global configuration options

In addition to the plugin-specific configuration settings, plugins support additional global and plugin configuration settings. These settings are used to modify metrics, tags, and field or create aliases and configure ordering, etc. See the CONFIGURATION.md for more details.

Configuration

# Query given DNS server and gives statistics
[[inputs.dns_query]]
  ## servers to query
  servers = ["8.8.8.8"]

  ## Network is the network protocol name.
  # network = "udp"

  ## Domains or subdomains to query.
  # domains = ["."]

  ## Query record type.
  ## Possible values: A, AAAA, CNAME, MX, NS, PTR, TXT, SOA, SPF, SRV.
  # record_type = "A"

  ## Dns server port.
  # port = 53

  ## Query timeout
  # timeout = "2s"

  ## Include the specified additional properties in the resulting metric.
  ## The following values are supported:
  ##    "first_ip" -- return IP of the first A and AAAA answer
  ##    "all_ips"  -- return IPs of all A and AAAA answers
  # include_fields = []

Metrics

  • dns_query
    • tags:
      • server
      • domain
      • record_type
      • result
      • rcode
    • fields:
      • query_time_ms (float)
      • result_code (int, success = 0, timeout = 1, error = 2)
      • rcode_value (int)

Rcode Descriptions

rcode_valuercodeDescription
0NoErrorNo Error
1FormErrFormat Error
2ServFailServer Failure
3NXDomainNon-Existent Domain
4NotImpNot Implemented
5RefusedQuery Refused
6YXDomainName Exists when it should not
7YXRRSetRR Set Exists when it should not
8NXRRSetRR Set that should exist does not
9NotAuthServer Not Authoritative for zone
10NotZoneName not contained in zone
16BADSIGTSIG Signature Failure
16BADVERSBad OPT Version
17BADKEYKey not recognized
18BADTIMESignature out of time window
19BADMODEBad TKEY Mode
20BADNAMEDuplicate key name
21BADALGAlgorithm not supported
22BADTRUNCBad Truncation
23BADCOOKIEBad/missing Server Cookie

Example Output

dns_query,domain=google.com,rcode=NOERROR,record_type=A,result=success,server=127.0.0.1 rcode_value=0i,result_code=0i,query_time_ms=0.13746 1550020750001000000

Was this page helpful?

Thank you for your feedback!


The future of Flux

Flux is going into maintenance mode. You can continue using it as you currently are without any changes to your code.

Read more

New in InfluxDB 3.4

Key enhancements in InfluxDB 3.4 and the InfluxDB 3 Explorer 1.2.

See the Blog Post

InfluxDB 3.4 is now available for both Core and Enterprise, which introduces offline token generation for use in automated deployments and configurable license type selection that lets you bypass the interactive license prompt. InfluxDB 3 Explorer 1.2 is also available, which includes InfluxDB cache management and other new features.

For more information, check out: