Skip to main content

DNS

Performs queries to a DNS server, typical use cases include:

  • Checking the latency of the DNS server in a Kubernetes cluster
  • Verifying that there are serving records for a DNS based load balancer.
dns.yaml
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: dns-pass
spec:
schedule: "@every 1m"
dns:
- server: 8.8.8.8
name: A record query
port: 53
query: "1.2.3.4.nip.io"
querytype: "A"
minrecords: 1
exactreply: ["1.2.3.4"]
timeout: 100
thresholdMillis: 1000
- server: 1.1.1.1
port: 53
name: ptr query
query: "1.1.1.1"
querytype: "PTR"
minrecords: 1
exactreply: ["one.one.one.one."]
timeout: 100
thresholdMillis: 100
- server: 8.8.8.8
port: 53
name: cname query
query: "dns.google"
querytype: "CNAME"
minrecords: 1
exactreply: ["dns.google."]
timeout: 100
thresholdMillis: 1000
- server: 8.8.8.8
port: 53
query: "flanksource.com"
name: mx query
querytype: "MX"
minrecords: 1
exactreply:
- "aspmx.l.google.com. 1"
- "alt1.aspmx.l.google.com. 5"
- "alt2.aspmx.l.google.com. 5"
- "aspmx3.googlemail.com. 10"
- "aspmx2.googlemail.com. 10"
timeout: 100
thresholdMillis: 1000
- server: 8.8.8.8
port: 53
name: txt query
query: "flanksource.com"
querytype: "TXT"
minrecords: 1
timeout: 100
thresholdMillis: 1000
- server: 8.8.8.8
port: 53
name: NS query
query: "flanksource.com"
querytype: "NS"
minrecords: 1
exactreply:
- "ns-91.awsdns-11.com."
- "ns-908.awsdns-49.net."
- "ns-1450.awsdns-53.org."
- "ns-1896.awsdns-45.co.uk."
timeout: 100
thresholdMillis: 1000
# - server: 8.8.8.8
# port: 53
# querytype: "SRV"
# query: "_test._tcp.test"
# timeout: 10
# srvReply:
# target: ""
# port: 0
# priority: 0
# weight: 0*
FieldDescriptionScheme
name*

Name of the check, must be unique within the canary

string

query*

Domain name to lookup

string

server*

Address of DNS server to query e.g. 8.8.8.8

string

exactreply

Expected exact match result(s)

[]string

minrecords

Minimum number of records expected in response

integer

port

Port to query DNS server on. Defaults to 53

querytype

Record type to query e.g. A, CNAME, TXT, SRV. Defaults to A

string

thresholdMillis

Threshold response time from DNS server

integer

timeout

Timeout in seconds

integer

description

Description for the check

string

display

Expression to change the formatting of the display

Expression

icon

Icon for overwriting default icon on the dashboard

Icon

labels

Labels for check

map[string]string

metrics

Metrics to export from

[]Metrics

test

Evaluate whether a check is healthy

Expression

transform

Transform data from a check into multiple individual checks

Expression