@@ -249,7 +249,13 @@ type DNS01Solver struct {
249
249
// The TTL for the temporary challenge records.
250
250
TTL time.Duration
251
251
252
- // Maximum time to wait for temporary record to appear.
252
+ // How long to wait before starting propagation checks.
253
+ // Default: 0 (no wait).
254
+ PropagationDelay time.Duration
255
+
256
+ // Maximum time to wait for temporary DNS record to appear.
257
+ // Set to -1 to disable propagation checks.
258
+ // Default: 2 minutes.
253
259
PropagationTimeout time.Duration
254
260
255
261
// Preferred DNS resolver(s) to use when doing DNS lookups.
@@ -314,18 +320,36 @@ func (s *DNS01Solver) Present(ctx context.Context, challenge acme.Challenge) err
314
320
// authoritative lookups, i.e. until it has propagated, or until
315
321
// timeout, whichever is first.
316
322
func (s * DNS01Solver ) Wait (ctx context.Context , challenge acme.Challenge ) error {
323
+ // if configured to, pause before doing propagation checks
324
+ // (even if they are disabled, the wait might be desirable on its own)
325
+ if s .PropagationDelay > 0 {
326
+ select {
327
+ case <- time .After (s .PropagationDelay ):
328
+ case <- ctx .Done ():
329
+ return ctx .Err ()
330
+ }
331
+ }
332
+
333
+ // skip propagation checks if configured to do so
334
+ if s .PropagationTimeout == - 1 {
335
+ return nil
336
+ }
337
+
338
+ // prepare for the checks by determining what to look for
317
339
dnsName := challenge .DNS01TXTRecordName ()
318
340
if s .OverrideDomain != "" {
319
341
dnsName = s .OverrideDomain
320
342
}
321
343
keyAuth := challenge .DNS01KeyAuthorization ()
322
344
345
+ // timings
323
346
timeout := s .PropagationTimeout
324
347
if timeout == 0 {
325
348
timeout = 2 * time .Minute
326
349
}
327
350
const interval = 2 * time .Second
328
351
352
+ // how we'll do the checks
329
353
resolvers := recursiveNameservers (s .Resolvers )
330
354
331
355
var err error
0 commit comments