2016-02-15 15:10:04 +00:00
|
|
|
# DNS Query Input Plugin
|
2016-02-13 18:00:42 +00:00
|
|
|
|
|
|
|
The DNS plugin gathers dns query times in miliseconds - like [Dig](https://en.wikipedia.org/wiki/Dig_\(command\))
|
|
|
|
|
|
|
|
### Configuration:
|
|
|
|
|
|
|
|
```
|
|
|
|
# Sample Config:
|
2016-02-15 15:10:04 +00:00
|
|
|
[[inputs.dns_query]]
|
2016-02-21 17:43:24 +00:00
|
|
|
## servers to query
|
2016-02-13 18:00:42 +00:00
|
|
|
servers = ["8.8.8.8"] # required
|
|
|
|
|
2016-02-21 17:43:24 +00:00
|
|
|
## Domains or subdomains to query. "." (root) is default
|
|
|
|
domains = ["."] # optional
|
|
|
|
|
|
|
|
## Query record type. Posible values: A, AAAA, ANY, CNAME, MX, NS, PTR, SOA, SPF, SRV, TXT. Default is "NS"
|
|
|
|
record_type = "A" # optional
|
2016-02-13 18:00:42 +00:00
|
|
|
|
2016-02-21 17:43:24 +00:00
|
|
|
## Dns server port. 53 is default
|
2016-02-13 18:00:42 +00:00
|
|
|
port = 53 # optional
|
|
|
|
|
2016-02-21 17:43:24 +00:00
|
|
|
## Query timeout in seconds. Default is 2 seconds
|
2016-02-13 18:00:42 +00:00
|
|
|
timeout = 2 # optional
|
|
|
|
```
|
|
|
|
|
|
|
|
For querying more than one record type make:
|
2016-02-21 17:43:24 +00:00
|
|
|
|
2016-02-13 18:00:42 +00:00
|
|
|
```
|
2016-02-15 15:10:04 +00:00
|
|
|
[[inputs.dns_query]]
|
2016-02-13 18:00:42 +00:00
|
|
|
domains = ["mjasion.pl"]
|
|
|
|
servers = ["8.8.8.8", "8.8.4.4"]
|
2016-02-21 17:43:24 +00:00
|
|
|
record_type = "A"
|
2016-02-13 18:00:42 +00:00
|
|
|
|
2016-02-15 15:10:04 +00:00
|
|
|
[[inputs.dns_query]]
|
2016-02-13 18:00:42 +00:00
|
|
|
domains = ["mjasion.pl"]
|
|
|
|
servers = ["8.8.8.8", "8.8.4.4"]
|
2016-02-21 17:43:24 +00:00
|
|
|
record_type = "MX"
|
2016-02-13 18:00:42 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Tags:
|
|
|
|
|
2016-02-21 17:43:24 +00:00
|
|
|
- server
|
2016-02-13 18:00:42 +00:00
|
|
|
- domain
|
2016-02-21 17:43:24 +00:00
|
|
|
- record_type
|
2016-02-13 18:00:42 +00:00
|
|
|
|
|
|
|
### Example output:
|
|
|
|
|
|
|
|
```
|
2017-05-12 22:22:29 +00:00
|
|
|
./telegraf --config telegraf.conf --input-filter dns_query --test
|
2016-02-21 17:43:24 +00:00
|
|
|
> dns_query,domain=mjasion.pl,record_type=A,server=8.8.8.8 query_time_ms=67.189842 1456082743585760680
|
2016-02-13 18:00:42 +00:00
|
|
|
```
|