Ubiety.Dns.Core 5.1.0

dotnet add package Ubiety.Dns.Core --version 5.1.0
                    
NuGet\Install-Package Ubiety.Dns.Core -Version 5.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ubiety.Dns.Core" Version="5.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ubiety.Dns.Core" Version="5.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Ubiety.Dns.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ubiety.Dns.Core --version 5.1.0
                    
#r "nuget: Ubiety.Dns.Core, 5.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Ubiety.Dns.Core@5.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ubiety.Dns.Core&version=5.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Ubiety.Dns.Core&version=5.1.0
                    
Install as a Cake Tool

Logo Ubiety.Dns.Core Nuget

A reusable DNS resolver for .NET

Thank you to the initial work of Alphons van der Heijden and Geoffry Huntley on this library.

Branch Quality Appveyor Coverage
Main Codacy branch grade AppVeyor branch Codecov branch
Develop Codacy branch grade AppVeyor branch Codecov branch

Installing / Getting started

Ubiety DNS Core targets .NET 10 and is available from NuGet

dotnet package add Ubiety.Dns.Core

You can also use your favorite NuGet client.

Usage

Build a resolver with ResolverBuilder, then query it and pull out the record type you care about:

using Ubiety.Dns.Core;
using Ubiety.Dns.Core.Common;
using Ubiety.Dns.Core.Records.General;

var resolver = ResolverBuilder.Begin()
    .AddDnsServer("1.1.1.1")
    .SetTimeout(5000)
    .SetRetries(2)
    .UseRecursion()
    .EnableCache()
    .Build();

var response = resolver.Query("example.com", QuestionType.A);

foreach (var record in response.GetRecords<RecordA>())
{
    Console.WriteLine(record.Address);
}

There is an async equivalent that takes a cancellation token:

var response = await resolver.QueryAsync("example.com", QuestionType.A, cancellationToken);

The question class defaults to IN; pass it explicitly when you need another one:

var response = await resolver.QueryAsync(
    "example.com", QuestionType.A, QuestionClass.CH, cancellationToken);

QueryAsync is asynchronous the whole way down rather than the synchronous path wrapped in a task. A cancelled token abandons the query and throws OperationCanceledException; that is distinct from the configured timeout, which fails over to the next server and eventually returns a Response with TimedOut set. A cached answer is returned without awaiting anything.

If no DNS server is added the builder falls back to the system resolvers. Queries go over TCP by default; set resolver.TransportType = TransportType.Udp to use UDP instead. A query that no server answers returns a Response with TimedOut set rather than throwing.

src/Dns.Sample is a small runnable program that does the same thing from the command line.

Developing

Here's a brief intro about what a developer must do in order to start developing the project further:

git clone https://github.com/ubiety/Ubiety.Dns.Core.git
cd Ubiety.Dns.Core
dotnet restore

Clone the repository and then restore the development requirements. You can use any editor: Rider, VS Code or Visual Studio. Building requires the .NET SDK version pinned in global.json.

Building

The build is driven by NUKE. Use build.cmd on Windows and build.sh elsewhere:

./build.sh Compile     # restore and compile
./build.sh Test        # run the tests with coverage
./build.sh Pack        # produce the NuGet package in ./artifacts
./build.sh Docs        # build the documentation site into docs/_site

Running dotnet build and dotnet test directly works too.

Documentation

The site is DocFX. The API reference is generated from the XML documentation comments in the source, so it cannot drift from the code; the guides under docs/articles are hand written.

dotnet tool restore
dotnet docfx docs/docfx.json --serve    # http://localhost:8080

The site deploys to Netlify from netlify.toml. The Netlify build image has no .NET, so docs/netlify-build.sh installs the SDK version pinned in global.json before running DocFX, caching it under /opt/build/cache so later builds skip the download.

Contributing

Thank you for your assistance. Please find more information on how to contribute in the CONTRIBUTING.md

Ubiety.Dns.Core for enterprise

Available as part of the Tidelift Subscription

The maintainers of Ubiety.Dns.Core and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.

Sponsors

Gold Sponsors

Gold Sponsors

Silver Sponsors

Silver Sponsors

Bronze Sponsors

Bronze Sponsors

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on Ubiety.Dns.Core:

Package Downloads
CPSysUDB

[pt-BR] .NET Framework 4.7.2 ou posterior * Uso de entidades (classes), cada entidade é uma tabela no banco de dados * Rotina para sempre recriar o banco de dados (muito útil para desenvolvimento) com opção para desabilitar * Controle total das rotinas de criação e atualização do banco de dados * Comunicação híbrida com SQL Server, MySQL, Firebird e SQLite sem necessidade de criar querys separadas apenas trocando os dados de conexão * Auto atualização do banco de dados, tabelas e campos * Criação de PK com auto incremento e FK * Respeitar regras do banco de dados (não usar palavras reservadas, criação das tabelas por dependência, ...) * Cria o banco de dados automaticamente * Create DataBase, Create Table, Insert, Update, Delete, Select * Uso de funções como count, max, min, avg, upper, lower, trim nos campos do select e do where * Where, Order By, Group By, Union, Limit e Joins * Suporte para int, string, DateTime, double e enum * Suporte para funções do banco de dados como GETDATE e DATEADD * Suporte para usar um campo de uma tabela no where * Compatível com WEB e Desktop [en-US] .NET Framework 4.7.2 or later * Usage of entities (class), each entity is a table in the database * Routine to always recreate the database (very useful for development) with option to disable * Full control of database creation and update routines * Hybrid communication with SQL Server, MySQL, Firebird and SQLite without the need to create separate queries just exchanging connection data * Auto update of database, tables and fields * PK creation with auto increment and FK * Respect database rules (do not use reserved words, creation of tables by dependency, ...) * Creates the database automatically * Create DataBase, Create Table, Insert, Update, Delete, Select * Use of functions like count, max, min, avg, upper, lower, trim in select and where fields * Where, Order By, Group By, Union, Limit and Joins * Support for int, string, DateTime, double and enum * Support for database functions like GETDATE and DATEDD * Support for using a field from a table in where * Compatible with WEB and Desktop

zAppDev.DotNet.Framework

Package Description

Hath.PlayerStats

Enriches your server by saving and displaying player statistics. a range of in-game performance metrics, and other pertinent data.

IsrarCommonLib

Commons utility library

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.1.0 682 7/29/2026
4.2.2 160,874 10/29/2021
4.2.1 4,507 12/8/2020
4.2.0 96,394 6/6/2020
4.1.2 57,389 4/1/2020
4.1.1 3,014 4/1/2020
4.1.0 3,277 3/31/2020
4.0.0 12,654 3/28/2020
3.0.4 3,068 3/27/2020
3.0.3 4,462 3/25/2020
3.0.2 23,760 3/24/2020
2.5.0 81,747 1/22/2020
2.4.1 170,448 8/25/2019
2.3.0 21,777 3/12/2019
2.3.0-alpha0039 1,250 3/12/2019
2.2.1 66,752 6/22/2018
2.2.0 3,780 6/22/2018
2.0.0 4,572 6/8/2018