MichaCo / DnsClient.NET

DnsClient.NET is a simple yet very powerful and high performant open source library for the .NET Framework to do DNS lookups
https://dnsclient.michaco.net
Apache License 2.0
789 stars 137 forks source link

Implementing / contributing record implementations #155

Closed jol64 closed 2 years ago

jol64 commented 2 years ago

I want to use DnsClient to obtain HTTPS records. Unfortunately not supported yet, and also just a draft standard - https://datatracker.ietf.org/doc/draft-ietf-dnsop-svcb-https/00/?include_text=1 - I definitley don´t want to blame you for not supporting draft records. But I´d appreciate guidance how to implement and potentially contribute that record type.

The situation is kind of special, as HTTPS and SCVB records are essentially the same, but may have different flavours, AliasForm or ServiceForm. Actually I only need the HTTPS Alias flavour, and from a wire representation that has the same structure than MX, thus I duplicated definitions from MX, and got a working version for my use case, ignoring SCVB and ServiceForm, which is actually a lot more complex.

Any suggestion? Would you recomment dedicated records for the flavours? What tests would you recommend if any?

And related: To get going I also like to see an enhancement to UnknownRecord that would allow to use a than public DnsDatagramReader. Then any client could just complement knowledge in private code.

MichaCo commented 2 years ago

I agree and will make DnsDatagramReader public. I'll not guarantee stability of that class' API though. That class can change and receive breaking changes any time. But I agree that it would be interesting for experiments and such.

For adding resource records to this library in general: Feel free to add a PR with changes. I will only accept code which is properly formatted, unit tested and in line with how the rest of the code base looks like.

So, if you want to add new resource records then that's a new class for each record type etc..

If you are not sure what/how to add, just create a design (issue) here and let me review it before you spend time on coding something which then turns out to be not what I'd accept.