-
Notifications
You must be signed in to change notification settings - Fork 100
Portable dns linux support #402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
SteveSyfuhs
merged 13 commits into
dotnet:develop
from
petrsnd:portable-dns-linux-support
Sep 11, 2025
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2d457b5
Add a PortableDns project to Kerberos.NET
petrsnd c15e8ba
Refactor Bruce to use PortableDns project on non-Windows platforms
petrsnd df5f8ac
Building on Windows with up-to-date targets
petrsnd 496e8ca
Nullable handling and generate assembly info
petrsnd f80cc9f
Conditionally remove Windows Forms code
petrsnd 4724cce
Don't detect line endings as diffs on Linux
petrsnd 0234092
Fix help command alias printing
petrsnd e094d33
Use XDG_CONFIG_HOME by default
petrsnd bbf1d79
Attrs must be constants, use conditional compilation
petrsnd 0a29b6c
Added config comments and variable expansion
petrsnd 7811d43
Use nullable regions for code that has introduced nullable
petrsnd abb2a62
Make sure that Krb5ConfigDefaults uses correct values on each support…
petrsnd 0a45b9b
Drop moniker and platform id for packaging
SteveSyfuhs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>netstandard2.0</TargetFramework> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="DnsClient" Version="1.8.0" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\Kerberos.NET\Kerberos.NET.csproj" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| using DnsClient; | ||
| using System.Linq; | ||
| using System.Net; | ||
|
|
||
| namespace Kerberos.NET.PortableDns | ||
| { | ||
| public static class PortableDnsClient | ||
| { | ||
| public static void Configure() | ||
| { | ||
| PortableDnsImplementation.Options = new LookupClientOptions(); | ||
| } | ||
|
|
||
| public static void Configure(params NameServer[] nameServers) | ||
| { | ||
| PortableDnsImplementation.Options = new LookupClientOptions(nameServers); | ||
| } | ||
|
|
||
| public static void Configure(params IPEndPoint[] nameServers) | ||
| { | ||
| PortableDnsImplementation.Options = new LookupClientOptions(nameServers); | ||
| } | ||
|
|
||
| public static void Configure(params IPAddress[] nameServers) | ||
| { | ||
| PortableDnsImplementation.Options = new LookupClientOptions(nameServers); | ||
| } | ||
|
|
||
| public static void Configure(params string[] nameServers) | ||
| { | ||
| PortableDnsImplementation.Options = new LookupClientOptions(nameServers.Select(n => { | ||
| var parts = n.Split(':'); | ||
| IPAddress address; | ||
| switch (parts.Length) | ||
| { | ||
| case 1: | ||
| address = IPAddress.Parse(parts[0]); | ||
| return new IPEndPoint(address, 53); | ||
| case 2: | ||
| address = IPAddress.Parse(parts[0]); | ||
| var port = int.Parse(parts[1]); | ||
| return new IPEndPoint(address, port); | ||
| default: | ||
| throw new System.FormatException($"{n} is not in the correct format 'IPaddress:Port'"); | ||
| } | ||
| }).ToArray()); | ||
| } | ||
|
|
||
| public static LookupClientOptions Options => PortableDnsImplementation.Options; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing this. It's been mildly bugging me for a while now.