Skip to content

Queries for non-existent record type take long time to eventually time out #37

@gmilos

Description

@gmilos

On macOS, an attempt to resolve name for which the particular record type doesn't exist, results in long (~30s) delay.

For example:

AsyncDNSResolver().queryA(name: "some.domain.without.A.record")

An investigation showed that adding the additional kDNSServiceFlagsReturnIntermediates, to the DNSServiceQueryRecord invocation fixes the delay problem. However, now the code has to handle the possibility that CNAME gets returned instead of the requested record type, thus requiring it to inspect the rrclass and rrtype returned to the innermost handler here. If CNAME is returned, the desired query should be repeated on that CNAME, otherwise an error should be generated.

PRs welcome if someone beats me to the implementation.

Tested with https://github.com/apple/swift-async-dns-resolver/releases/tag/0.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions