@@ -141,6 +141,10 @@ func ProbeDNS(ctx context.Context, target string, module config.Module, registry
141141 Name : "probe_dns_additional_rrs" ,
142142 Help : "Returns number of entries in the additional resource record list" ,
143143 })
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+ })
144148 probeDNSQuerySucceeded := prometheus .NewGauge (prometheus.GaugeOpts {
145149 Name : "probe_dns_query_succeeded" ,
146150 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
154158 registry .MustRegister (probeDNSAnswerRRSGauge )
155159 registry .MustRegister (probeDNSAuthorityRRSGauge )
156160 registry .MustRegister (probeDNSAdditionalRRSGauge )
161+ registry .MustRegister (probeDNSFlagDo )
157162 registry .MustRegister (probeDNSQuerySucceeded )
158163
159164 qc := uint16 (dns .ClassINET )
@@ -257,6 +262,7 @@ func ProbeDNS(ctx context.Context, target string, module config.Module, registry
257262 msg .RecursionDesired = module .DNS .Recursion
258263 msg .Question = make ([]dns.Question , 1 )
259264 msg .Question [0 ] = dns.Question {dns .Fqdn (module .DNS .QueryName ), qt , qc }
265+ msg .SetEdns0 (client .UDPSize , true )
260266
261267 logger .Info ("Making DNS query" , "target" , targetIP , "dial_protocol" , dialProtocol , "query" , module .DNS .QueryName , "type" , qt , "class" , qc )
262268 timeoutDeadline , _ := ctx .Deadline ()
@@ -280,6 +286,12 @@ func ProbeDNS(ctx context.Context, target string, module config.Module, registry
280286 probeDNSAdditionalRRSGauge .Set (float64 (len (response .Extra )))
281287 probeDNSQuerySucceeded .Set (1 )
282288
289+ if opt := response .IsEdns0 (); opt != nil && opt .Do () {
290+ probeDNSFlagDo .Set (1 )
291+ } else {
292+ probeDNSFlagDo .Set (0 )
293+ }
294+
283295 if qt == dns .TypeSOA {
284296 probeDNSSOAGauge = prometheus .NewGauge (prometheus.GaugeOpts {
285297 Name : "probe_dns_serial" ,
0 commit comments