You can install DnsToys.NET through NuGet.
Supported frameworks are;
- .NET 6 and 5
- .NET Standard 2.1 and 2.0
- .NET Framework 4.7.1
Here are the available options.
Install-Package DnsToys
dotnet add package DnsToys
paket add DnsToys
// Install DnsToys as a Cake Addin
#addin nuget:?package=DnsToys&version=1.0.0
// Install DnsToys as a Cake Tool
#tool nuget:?package=DnsToys&version=1.0.0
You can use the DnsToys
class' parameterless constructor directly. Sample below fetches the current requesting IP using the service.
using System.Net;
using DnsToysNET;
using DnsToysNET.Models;
...
IDnsToys client = new DnsToys();
IDnsToysIpEntry result = await client.IpAsync();
IPAddress requestingIP = result.RequestingIP;
- help
- time
- ip
- fx
- unit
- words
- cidr
- weather
- pi
- base
Library is developed with unit testing in mind, so you can mock all the models, parsers, raw requester and the main client itself.