@@ -141,6 +141,10 @@ func ProbeDNS(ctx context.Context, target string, module config.Module, registry
141
141
Name : "probe_dns_additional_rrs" ,
142
142
Help : "Returns number of entries in the additional resource record list" ,
143
143
})
144
+ probeDNSFlagAd := prometheus .NewGauge (prometheus.GaugeOpts {
145
+ Name : "probe_dns_flag_ad" ,
146
+ Help : "Returns whether or not the query had the DNSSEC AD flag set" ,
147
+ })
144
148
probeDNSQuerySucceeded := prometheus .NewGauge (prometheus.GaugeOpts {
145
149
Name : "probe_dns_query_succeeded" ,
146
150
Help : "Displays whether or not the query was executed successfully" ,
@@ -154,6 +158,7 @@ func ProbeDNS(ctx context.Context, target string, module config.Module, registry
154
158
registry .MustRegister (probeDNSAnswerRRSGauge )
155
159
registry .MustRegister (probeDNSAuthorityRRSGauge )
156
160
registry .MustRegister (probeDNSAdditionalRRSGauge )
161
+ registry .MustRegister (probeDNSFlagAd )
157
162
registry .MustRegister (probeDNSQuerySucceeded )
158
163
159
164
qc := uint16 (dns .ClassINET )
@@ -255,6 +260,7 @@ func ProbeDNS(ctx context.Context, target string, module config.Module, registry
255
260
msg := new (dns.Msg )
256
261
msg .Id = dns .Id ()
257
262
msg .RecursionDesired = module .DNS .Recursion
263
+ msg .AuthenticatedData = true
258
264
msg .Question = make ([]dns.Question , 1 )
259
265
msg .Question [0 ] = dns.Question {dns .Fqdn (module .DNS .QueryName ), qt , qc }
260
266
@@ -280,6 +286,12 @@ func ProbeDNS(ctx context.Context, target string, module config.Module, registry
280
286
probeDNSAdditionalRRSGauge .Set (float64 (len (response .Extra )))
281
287
probeDNSQuerySucceeded .Set (1 )
282
288
289
+ if response .AuthenticatedData {
290
+ probeDNSFlagAd .Set (1 )
291
+ } else {
292
+ probeDNSFlagAd .Set (0 )
293
+ }
294
+
283
295
if qt == dns .TypeSOA {
284
296
probeDNSSOAGauge = prometheus .NewGauge (prometheus.GaugeOpts {
285
297
Name : "probe_dns_serial" ,
0 commit comments