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