Skip to content

Direct query to the server for a zone's SOA record fails #30

@richardparker

Description

@richardparker

A query to the server for a zone's own SOA record returns NXDOMAIN, when I would expect it to return the SOA record for the zone. This appears to happen because the SOA record is in the Zone's soa property, not an element of the Zone's records array, so a match is not found by lookup() in Utopia\DNS\Zone\Resolver.

A possible fix would be to add an explicit check for a query for the SOA record in Utopia\DNS\Zone\Resolver::lookup() after the check for zero queries, just before selecting the best matching records.

// Return the zone's SOA record
if (($question->type === Record::TYPE_SOA) && ($question->name === $zone->name) {
	return Message::response(
		header: $query->header,
		responseCode: Message::RCODE_NOERROR,
		questions: $query->questions,
		answers: [$zone->soa],
		authoritative: true,
		recursionAvailable: false
	);
}

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