netanelcyber / netanelcyber/AdPentestAI-Python

Performance: DNS query batching and caching

Open
#17 1 comment 0 reactions 1 assignee View on GitHub

@tenten48tenten is already working on this.

Since Sep 16, 2026.

dns help-wanted optimization performance v1.1.0
Dominant language
Python
Stars
5
Forks
2
Avg merge
22h 25m
Merged PRs (30d)
7

Description

Description

Implement DNS query batching and response caching to reduce DNS query latency and server load during discovery.

Current Behavior

  • Sequential DNS queries (1 at a time)
  • No caching of results
  • Repeated queries for same domain
  • High latency for bulk operations (SRV, A, MX queries)

Proposed Implementation

  1. DNS Query Batching

    • Batch queries by type (A, AAAA, SRV, MX, PTR)
    • ThreadPoolExecutor with 32 workers for parallel queries
    • Concurrent resolution of multiple domains
  2. Response Caching

    • In-memory cache (LRU, max 1000 entries)
    • TTL-aware expiration
    • Persistent optional cache (SQLite)
    • Cache invalidation on manual request
  3. Query Optimization

    • Deduplicate identical queries
    • Batch reverse DNS lookups (PTR)
    • Parallel SRV record queries
    • Fallback chain optimization

Requirements

  • 20-30x speedup on bulk DNS queries (100+ lookups)
  • Memory usage < 50MB for cached data
  • Configurable cache size and TTL
  • Per-tool DNS query metrics

Files to Update

  • adpentest/core.py - Integrate batching
  • Update: GLOBAL_DNS_CONFIG class
  • Add: DNS cache class

Success Criteria

  • 100 domain queries: < 2 seconds (vs ~30s sequential)
  • Cache hit rate > 70% on repeated queries
  • No cache invalidation issues under race conditions

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.