Kerberos.NET icon indicating copy to clipboard operation
Kerberos.NET copied to clipboard

Add support for DNS in non-Windows environments

Open SteveSyfuhs opened this issue 5 years ago • 5 comments

Is your feature request related to a problem? Please describe. DNS lookups only work on Windows today because it calls into win32 APIs directly. .NET doesn't provide a way to query for SRV records.

Describe the solution you'd like The library needs a way to make DNS queries outside of Windows. The solution should be to provide a way to bring your own DNS implementation that way you can use something like https://github.com/MichaCo/DnsClient.NET on other platforms.

Describe alternatives you've considered You could rely completely on a krb5 configuration file to provide all the necessary records, but that's complicated and messy.

Additional context Design should be similar to the CryptoPal so callers can register their DNS mechanisms. A side-car nuget package could be created that wires in the DnsClient.NET implementation.

SteveSyfuhs avatar Aug 23 '20 16:08 SteveSyfuhs

For folks running into this issue, there's a super simple platform-independent implementation available in the Bruce tool. It uses the DnsClient.NET library as mentioned above. It's kept out of the main project reduce total external dependencies.

https://github.com/dotnet/Kerberos.NET/blob/946daea47a347a0ad9dcb645f2c6e82a8c94372f/Bruce/Dns/PlatformIndependentDnsClient.cs#L1-L50

SteveSyfuhs avatar May 26 '21 19:05 SteveSyfuhs

This class is very useful, but a bit hard to find. Is there a NuGet package that includes it? Would be great to be able to include something like Kerberos.NET.Portable, instead of copying the class in all projects that need it.

MageFroh avatar Jan 15 '23 11:01 MageFroh

PR's are accepted to get that working.

SteveSyfuhs avatar Jan 18 '23 18:01 SteveSyfuhs

As requested by the contribution guidelines: I'm working on it

0x5ECF4ULT avatar Feb 01 '23 16:02 0x5ECF4ULT

Awesome! The build process is somewhat of a pain to verify, but it should just be a matter of duplicating the kerberos.net lines in the build file and replacing the names with the new project/package name (https://github.com/dotnet/Kerberos.NET/blob/develop/build.yaml)

SteveSyfuhs avatar Feb 01 '23 17:02 SteveSyfuhs