@@ -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
+ probeDNSFlagDo := prometheus .NewGauge (prometheus.GaugeOpts {
145
+ Name : "probe_dns_flag_do" ,
146
+ Help : "Returns whether or not the query had the DNSSEC OK 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 (probeDNSFlagDo )
157
162
registry .MustRegister (probeDNSQuerySucceeded )
158
163
159
164
qc := uint16 (dns .ClassINET )
@@ -257,6 +262,7 @@ func ProbeDNS(ctx context.Context, target string, module config.Module, registry
257
262
msg .RecursionDesired = module .DNS .Recursion
258
263
msg .Question = make ([]dns.Question , 1 )
259
264
msg .Question [0 ] = dns.Question {dns .Fqdn (module .DNS .QueryName ), qt , qc }
265
+ msg .SetEdns0 (client .UDPSize , true )
260
266
261
267
logger .Info ("Making DNS query" , "target" , targetIP , "dial_protocol" , dialProtocol , "query" , module .DNS .QueryName , "type" , qt , "class" , qc )
262
268
timeoutDeadline , _ := ctx .Deadline ()
@@ -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 opt := response .IsEdns0 (); opt != nil && opt .Do () {
290
+ probeDNSFlagDo .Set (1 )
291
+ } else {
292
+ probeDNSFlagDo .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