reactphp/dns

Support for multiple types of DNS records

xocasdashdash opened this issue · 2 comments

Hi!

I'm looking to use react to build an app that would interact with Consul, ideally it would do so over normal DNS instead of over the HTTP api. For that to happen I would need this DNS library to support SRV records. Right now there´s only support for A and CNAME records (React\Dns\Protocol\Parser), I wanted to explore the idea of using a different approach and moving the DNS parsing to a different library, after researching some different options, this seem like a good candidate: https://github.com/DaveRandom/LibDNS.

That library is the same one used by icicle dns and it would allow to support much more record types without changing a lot of code here. Right now I think the biggest issue blocking this move would be that the library doesn´t parse streams per se, and with tcp queries ( >512 bytes responses) this could lead to some kind of blocking for extremely big payloads.

Has this road been explored? I´ve looking for info about this and on the https://github.com/async-interop/ group but I haven´t found much about it.

Has this been researched and discarded before?

thanks!
Great library!

Hey @xocasdashdash thank you for the suggestion. I'll have a chat with @clue about this. We could work around that 512+ byte issue possible. I'll try and create a prototype using that package soon

clue commented

Thanks for bringing this to our attention @xocasdashdash! I suppose we're not opposed to see how this works out if anybody feels like filing a PR 👍

That library is the same one used by icicle dns and it would allow to support much more record types without changing a lot of code here. Right now I think the biggest issue blocking this move would be that the library doesn´t parse streams per se, and with tcp queries ( >512 bytes responses) this could lead to some kind of blocking for extremely big payloads.

I agree and I believe this is best addressed in the outstanding issue #19 👍

[…] I would need this DNS library to support SRV records. Right now there´s only support for A and CNAME records (React\Dns\Protocol\Parser) […]

I think you're raising a relevant issue here! This component now supports some more types and there's an outstanding issue to support more types in #31. Adding new types is relatively easy and not really the main concern here as far as I can tell.

There are currently no immediate plans to build this from my end (no demand at the moment and more pressing issues), but I suppose we would be really happy to accept PRs and see how this works out 👍

I believe this has been answered, so I'm closing this for now. Please come back with more details if this issue persists and we can reopen this 👍