{"record":{"id":"80658b62a06fd28e","repo":"onetimesecret/onetimesecret","slug":"dns-verification-rate-limit-exceeded-please-wait","errorCode":null,"errorMessage":"DNS verification rate limit exceeded. Please wait before trying again.","messagePattern":"DNS verification rate limit exceeded\\. Please wait before trying again\\.","errorType":"exception","errorClass":"Onetime::LimitExceeded","httpStatus":429,"severity":"error","filePath":"lib/onetime/security/dns_rate_limiter.rb","lineNumber":100,"sourceCode":"      #\n      # @param domain_id [String] The domain's unique identifier\n      # @raise [Onetime::LimitExceeded] If rate limit is exceeded\n      # @return [Hash] Rate limit status with :remaining and :reset_in keys\n      def check_dns_rate_limit!(domain_id)\n        return default_rate_limit_status if domain_id.to_s.empty?\n\n        key = dns_rate_limit_key(domain_id)\n\n        # Atomically check limit and increment if allowed via server-side Lua script\n        current_count, ttl, _was_new_key, limit_exceeded = redis.eval(\n          CHECK_AND_INCREMENT_SCRIPT,\n          keys: [key],\n          argv: [RATE_WINDOW, MAX_VERIFICATIONS],\n        )\n\n        if limit_exceeded == 1\n          OT.li \"[DnsRateLimiter] Domain #{domain_id[0..7]} rate limited: #{current_count}/#{MAX_VERIFICATIONS}, reset in #{ttl}s\"\n          raise Onetime::LimitExceeded.new(\n            'DNS verification rate limit exceeded. Please wait before trying again.',\n            retry_after: ttl > 0 ? ttl : RATE_WINDOW,\n            attempts: current_count,\n            max_attempts: MAX_VERIFICATIONS,\n          )\n        end\n\n        remaining = MAX_VERIFICATIONS - current_count\n        reset_in  = ttl > 0 ? ttl : RATE_WINDOW\n\n        if remaining <= 2\n          OT.li \"[DnsRateLimiter] Domain #{domain_id[0..7]} approaching limit: #{current_count}/#{MAX_VERIFICATIONS}\"\n        end\n\n        {\n          remaining: remaining,\n          reset_in: reset_in,\n          current: current_count,","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/onetimesecret/onetimesecret/blob/f81295e41bc3e808a3dd2cbea03ef65401a662e4/lib/onetime/security/dns_rate_limiter.rb#L82-L118","documentation":"Error \"DNS verification rate limit exceeded. Please wait before trying again.\" thrown in onetimesecret/onetimesecret.","triggerScenarios":"Thrown at lib/onetime/security/dns_rate_limiter.rb:100 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wait before retrying DNS verification; confirm the TXT record is correct first so fewer attempts are needed."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f81295e41bc3e808a3dd2cbea03ef65401a662e4","analyzedAt":"2026-08-23T21:13:10.635Z","schemaVersion":2},"datasetVersion":"2026-08-24T02:17:37.098Z"}