Skip to content

Enhancement: Optimize authoritative zone lookup #41

Description

@joyider

Summary

AuthoritativeZoneForName() currently scans all loaded zones to locate the longest matching authoritative suffix.

Problem

The current implementation performs work proportional to the number of hosted zones for every query.

As the number of zones grows, query processing becomes increasingly expensive.

Proposed solution

Replace linear scans with a more efficient lookup structure.

Options:

Option A (preferred)

Reverse-label trie.

Option B

Positive lookup cache:

map[string]string

mapping query names to authoritative zones.

Option C

Precomputed suffix index sorted by specificity.

Expected benefits

  • Faster authoritative zone discovery
  • Better scaling for installations hosting many zones
  • Reduced CPU usage per query

Priority

High

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions