[GH-ISSUE #48] Question regarding DNS question #18

Closed
opened 2026-03-04 23:23:45 +03:00 by kerem · 3 comments
Owner

Originally created by @ivanstan on GitHub (May 22, 2018).
Original GitHub issue: https://github.com/yswery/PHP-DNS-SERVER/issues/48

@yswery please take a look at:

https://github.com/yswery/PHP-DNS-SERVER/blob/master/src/JsonResolver.php:61

    /**
     * @param array $question
     * @return array
     */
    public function getAnswer(array $question)
    {
        $q_name = $question[0]['qname'];
        $q_type = $question[0]['qtype'];
        $q_class = $question[0]['qclass'];
        $domain = trim($q_name, '.');
        $type = RecordTypeEnum::get_name($q_type);

I don't understand why are we sending array of questions to the resolver->getAnswer() instead of just one question? We are always catching the first array element and resolving that as a question. Is it perhaps possible that user can ask for multiple queries and get the answers within a single request?

Originally created by @ivanstan on GitHub (May 22, 2018). Original GitHub issue: https://github.com/yswery/PHP-DNS-SERVER/issues/48 @yswery please take a look at: https://github.com/yswery/PHP-DNS-SERVER/blob/master/src/JsonResolver.php:61 ``` /** * @param array $question * @return array */ public function getAnswer(array $question) { $q_name = $question[0]['qname']; $q_type = $question[0]['qtype']; $q_class = $question[0]['qclass']; $domain = trim($q_name, '.'); $type = RecordTypeEnum::get_name($q_type); ``` I don't understand why are we sending array of questions to the resolver->getAnswer() instead of just one question? We are always catching the first array element and resolving that as a question. Is it perhaps possible that user can ask for multiple queries and get the answers within a single request?
kerem closed this issue 2026-03-04 23:23:46 +03:00
Author
Owner

@samuelwilliams commented on GitHub (Sep 8, 2018):

Had to Google this one. Apparently, even though RFC1035 does support multiple questions, it doesn't get implemented. https://stackoverflow.com/questions/4082081/requesting-a-and-aaaa-records-in-single-dns-query/4083071#4083071

<!-- gh-comment-id:419605822 --> @samuelwilliams commented on GitHub (Sep 8, 2018): Had to Google this one. Apparently, even though RFC1035 does support multiple questions, it doesn't get implemented. [https://stackoverflow.com/questions/4082081/requesting-a-and-aaaa-records-in-single-dns-query/4083071#4083071](https://stackoverflow.com/questions/4082081/requesting-a-and-aaaa-records-in-single-dns-query/4083071#4083071)
Author
Owner

@samuelwilliams commented on GitHub (Sep 11, 2018):

Having said that, it does depend on the resolver that you want to strap-in. If you want to answer multiple queries, do DNS clients support that functionality? When I do an NSLOOKUP for a domain, Windows by default will send two queries in two packets, the first is for an A record and the second is for an AAAA record., so I don't think there are many clients (if any) that have implemented RFC1035 word-for-word

<!-- gh-comment-id:420234963 --> @samuelwilliams commented on GitHub (Sep 11, 2018): Having said that, it does depend on the resolver that you want to strap-in. If you want to answer multiple queries, do DNS clients support that functionality? When I do an `NSLOOKUP` for a domain, Windows by default will send two queries in two packets, the first is for an A record and the second is for an AAAA record., so I don't think there are many clients (if any) that have implemented RFC1035 word-for-word
Author
Owner

@samuelwilliams commented on GitHub (Sep 16, 2018):

This has been addressed in branch version-1

<!-- gh-comment-id:421689184 --> @samuelwilliams commented on GitHub (Sep 16, 2018): This has been addressed in branch version-1
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/PHP-DNS-SERVER#18
No description provided.