[ transport_protocol: <string> | default = "udp" ] # udp, tcp
+# Whether to use DNS over TLS. This only works with TCP.
+[ dns_over_tls: <boolean | default = false> ]
+
query_name: <string>
[ query_type: <string> | default = "ANY" ]
type DNSProbe struct {
IPProtocol string `yaml:"preferred_ip_protocol,omitempty"`
IPProtocolFallback bool `yaml:"ip_protocol_fallback,omitempty"`
+ DNSOverTLS bool `yaml:"dns_over_tls,omitempty"`
SourceIPAddress string `yaml:"source_ip_address,omitempty"`
TransportProtocol string `yaml:"transport_protocol,omitempty"`
QueryClass string `yaml:"query_class,omitempty"` // Defaults to IN.
dialProtocol = module.DNS.TransportProtocol + "4"
}
+ if module.DNS.DNSOverTLS {
+ if module.DNS.TransportProtocol == "tcp" {
+ dialProtocol += "-tls"
+ } else {
+ level.Error(logger).Log("msg", "Configuration error: Expected transport protocol tcp for DoT", "protocol", module.DNS.TransportProtocol)
+ return false
+ }
+ }
+
client := new(dns.Client)
client.Net = dialProtocol