SimpleDNS 1.0.0

dotnet add package SimpleDNS --version 1.0.0
NuGet\Install-Package SimpleDNS -Version 1.0.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="SimpleDNS" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SimpleDNS --version 1.0.0
#r "nuget: SimpleDNS, 1.0.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.
// Install SimpleDNS as a Cake Addin
#addin nuget:?package=SimpleDNS&version=1.0.0

// Install SimpleDNS as a Cake Tool
#tool nuget:?package=SimpleDNS&version=1.0.0

SimpleDNS

A simple but comprehensive DNS library for C#

What is SimpleDNS?

SimpleDNS is an open source library which queries a DNS server of your choice and maps the received values to an object called DnsPacket. It was designed with ease in mind as well as giving the developer the option to drill down into results similar to how a DNS packet is viewed in a tool like Wireshark. It's been built to the standard proposed in the official RFC and the code has many references to certain sections of the RFC to aid other developers who wish to work on the project. What makes SimpleDNS different to other DNS libraries?

You can work with a DNS packet (Send/Receive) using OOP and the DNS results like the Flags in the header (Response, Opcode, Authoritative etc...) are all shown as immutable properties. Basically, you don't just get the result, you get the whole packet parsed into an object.

Okay...so how do I use it?

It's simple, you can either create a DNS packet manually used for sending which will then return a new object instance with results, or you can use the simple custom SimpleDNS model which in the background creates a DNSPacket using your values from the SimpleDNS model.

SimpleDNS Model Example:
//Create your question - (Hostname,QueryType)
var question = new Question("i.stack.imgur.com", QType.A);

//Create your SimpleDnsPacket and pass to the Util method Kitson.Dns.Query 
var result = Query.SimpleDnsAsync(new SimpleDnsPacket(question, IPAddress.Parse("8.8.8.8")));
Core DNS Model Example:
//DNS Header
UInt16 transactionId = 200;
IParameters parameters = new SendParameters(OPCode.Standard, true, false);
UInt16 questionsCount = 1;
UInt16 answersCounts = 0;
UInt16 authority = 0;
UInt16 additional = 0;

//DNS Question
var question = new Question("i.stack.imgur.com", QType.A);

//DNS Header Construction
IDnsHeader header = new DnsHeader(transactionId,parameters,questionsCount, answersCounts,authority, additional);

//SendDnsPacket Construction
SendDnsPacket packet = new SendDnsPacket(header, question);

//Finally...Send your packet to the chosen DNS Server
var result = Query.Dns(packet, IPAddress.Parse("8.8.8.8"));

And the results returned from the query above can be seen below...

Header Result:

Header

CName Record Result:

CName

A Record Result:

ARecord

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 is compatible.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 1,570 4/8/2018