[GH-ISSUE #5] Provder = Resolver? #3

Closed
opened 2026-03-04 23:23:37 +03:00 by kerem · 7 comments
Owner

Originally created by @codenamegary on GitHub (Nov 20, 2014).
Original GitHub issue: https://github.com/yswery/PHP-DNS-SERVER/issues/5

It occurred to me while going through setting up the testing that maybe "Provider" is not the best term for what the role of the provider is. I was thinking about maybe creating a Resolver interface... for example.

interface Resolver {

    public function get_answer($question);

}

And then logically it would follow that...

class JsonStorageResolver implements Resolver {

    public function get_answer($question)
    {
        // Implementation details...
    }

}

Not at all urgent, just food for thought. Seems like a reasonable abstraction given that I'm already thinking about creating a StackedProvider where get_answer() would query some JSON based records first and then fall back to query some other DNS server if the question was unanswered.

Originally created by @codenamegary on GitHub (Nov 20, 2014). Original GitHub issue: https://github.com/yswery/PHP-DNS-SERVER/issues/5 It occurred to me while going through setting up the testing that maybe "Provider" is not the best term for what the role of the provider is. I was thinking about maybe creating a Resolver interface... for example. ``` interface Resolver { public function get_answer($question); } ``` And then logically it would follow that... ``` class JsonStorageResolver implements Resolver { public function get_answer($question) { // Implementation details... } } ``` Not at all urgent, just food for thought. Seems like a reasonable abstraction given that I'm already thinking about creating a StackedProvider where get_answer() would query some JSON based records first and then fall back to query some other DNS server if the question was unanswered.
kerem 2026-03-04 23:23:37 +03:00
Author
Owner

@yswery commented on GitHub (Nov 20, 2014):

I like the idea. but first we need to implement the recursive DNS ability (to be able to pass on a DNS query to the name server of the give domain question)

Currently speaking the library is an authoritative nameserver only, meaning no recursion at all. However I would love to go into the future to enable queries outside and implementing what you suggest with the fall back if the domain record is not in storage.

This issue could probably be renamed to implementing a new feature which is the ability to make recursive DNS queries, and added to the to do list

<!-- gh-comment-id:63768802 --> @yswery commented on GitHub (Nov 20, 2014): I like the idea. but first we need to implement the recursive DNS ability (to be able to pass on a DNS query to the name server of the give domain question) Currently speaking the library is an authoritative nameserver only, meaning no recursion at all. However I would love to go into the future to enable queries outside and implementing what you suggest with the fall back if the domain record is not in storage. This issue could probably be renamed to implementing a new feature which is the ability to make recursive DNS queries, and added to the to do list
Author
Owner

@codenamegary commented on GitHub (Nov 20, 2014):

Oh for sure, might as well close this for now, was just a thought. :)

<!-- gh-comment-id:63808213 --> @codenamegary commented on GitHub (Nov 20, 2014): Oh for sure, might as well close this for now, was just a thought. :)
Author
Owner

@yswery commented on GitHub (Nov 20, 2014):

Na, dont close it, this abstraction will defiantly be a must.

In the upcoming weekend I will have some time and I will implement some back functionality to be able to do a recursive dns query if the domain is not in storage

<!-- gh-comment-id:63887276 --> @yswery commented on GitHub (Nov 20, 2014): Na, dont close it, this abstraction will defiantly be a must. In the upcoming weekend I will have some time and I will implement some back functionality to be able to do a recursive dns query if the domain is not in storage
Author
Owner

@codenamegary commented on GitHub (Nov 21, 2014):

Excellent. Not sure what your thoughts are around how to implement that, but here's a thought.

https://gist.github.com/codenamegary/88d86fc01b048f539601

<!-- gh-comment-id:63918890 --> @codenamegary commented on GitHub (Nov 21, 2014): Excellent. Not sure what your thoughts are around how to implement that, but here's a thought. https://gist.github.com/codenamegary/88d86fc01b048f539601
Author
Owner

@yswery commented on GitHub (Nov 22, 2014):

Initially I was thinking of adding the recursive functionality to the server, but on second thought its probably better be more as a provider here as you mentioned, ill follow your gist, seems like a solid idea

<!-- gh-comment-id:64072965 --> @yswery commented on GitHub (Nov 22, 2014): Initially I was thinking of adding the recursive functionality to the server, but on second thought its probably better be more as a provider here as you mentioned, ill follow your gist, seems like a solid idea
Author
Owner

@yswery commented on GitHub (Nov 22, 2014):

pushed some initial code into the feature/recursive-provider branch i will finish this later today

<!-- gh-comment-id:64095807 --> @yswery commented on GitHub (Nov 22, 2014): pushed some initial code into the feature/recursive-provider branch i will finish this later today
Author
Owner

@yswery commented on GitHub (Nov 23, 2014):

Done, feel free to re-factor and write tests, sadly I really didnt have as much time as I wanted for this this weekend :(

<!-- gh-comment-id:64107183 --> @yswery commented on GitHub (Nov 23, 2014): Done, feel free to re-factor and write tests, sadly I really didnt have as much time as I wanted for this this weekend :(
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#3
No description provided.