Black Box Exporter: Advanced Configurations, Probes and Tools
57%
The DNS Probe
The DNS probe is used to probe a DNS server by resolving a domain name. The configuration is similar to what we did previously. Here is how you can configure it:
cat < /etc/prometheus/blackbox.yml
modules:
dns_lookup:
prober: dns
dns:
# The query name to resolve
query_name: faun.dev
# A, AAAA, CNAME, MX, NS, PTR, SOA, SRV, TXT ..etc
query_type: A
EOF
Restart the Blackbox Exporter container:
docker restart blackbox_exporter
Let's say we want to use Google DNS and OpenDNS to probe the domain faun.dev. By querying different DNS servers, we can check the consistency and availability of DNS responses for our domain. This also allows us to detect potential DNS issues, such as resolution failures, discrepancies between DNS servers, or delays in DNS responses.
We already have the faun.dev target in the blackbox job. We will add the following targets to the blackbox job:
cat < /etc/prometheus/prometheus.yml
scrape_configs:
- job_name: 'blackbox'
metrics_path: /probe
params:
module: [dns_lookup]
static_configs:
- targets:
# Google DNS
- 8.8.8.8
- 8.8.4.4
# OpenDNS
- 208.67.222.222
- 208.67.220.220
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
-Observability with Prometheus and Grafana
A Complete Hands-On Guide to Operational Clarity in Cloud-Native SystemsEnroll now to unlock all content and receive all future updates for free.
