Skip to content

Handling multiple questions #2

@rm-hull

Description

@rm-hull

The HandleDNSRequest function does not correctly handle DNS requests containing multiple questions, as noted by the FIXME comment. The current logic iterates through questions and returns immediately upon the first blocked domain or cache hit. A valid DNS response must address all questions in the request. This will lead to incorrect behavior for clients that send multi-question requests.

The handler needs to be refactored to build a single response message that contains answers for all questions. This would involve iterating through all questions, collecting answers (from cache or upstream), handling blocked domains for each, and then assembling a final dns.Msg to send back.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions