WhoIsChecker 1.0.3

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

// Install WhoIsChecker as a Cake Tool
#tool nuget:?package=WhoIsChecker&version=1.0.3                

WhoIsChecker Library

WhoIsChecker is a .NET library for checking the expiration date of domains using WHOIS servers. This library supports multiple target frameworks including .NET Standard 2.1, .NET 6.0, and .NET 7.0.

Features

  • Query WHOIS information for domains.
  • Extract and convert the domain expiration date to local system time.
  • Calculate the number of days until a domain expires.
  • Automatically download and use the latest WHOIS server list.

Getting Started

Installation

To install WhoIsChecker, add the NuGet package to your project:

dotnet add package WhoIsChecker

Usage

Here's an example of how to use the WhoIsChecker library:

  1. Load WHOIS Servers: Load the WHOIS servers list from a JSON file or download it if it doesn't exist or is outdated.

  2. Query WHOIS Server: Query the WHOIS server for a domain's expiration date.

    using System;
    using System.Threading.Tasks;
    using WhoIsChecker.Data;
    using WhoIsChecker.Services;
    
    class Program
    {
        static async Task Main(string[] args)
        {
            if (args.Length == 0)
            {
                Console.WriteLine("Please provide a domain as an argument.");
                return;
            }
    
            string domain = args[0];
            string tld = GetTld(domain);
    
            var whoisServers = await DomainWhoisServers.LoadAsync();
    
            if (whoisServers.TryGetValue(tld, out string? whoisServer))
            {
                if (whoisServer == null)
                {
                    Console.WriteLine("NO WHOIS SERVER FOUND");
                }
                else
                {
                    var whoisService = new WhoisService();
                    var (expirationDate, message) = await whoisService.QueryWhoisServer(domain, whoisServer);
                    if (expirationDate != null)
                    {
                        Console.WriteLine($"Expiration Date (Local Time): {expirationDate}");
                    }
                    Console.WriteLine(message);
                }
            }
            else
            {
                Console.WriteLine("TLD not found in the list.");
            }
        }
    
        private static string GetTld(string domain)
        {
            var parts = domain.Split('.');
            return parts[^1].ToLower();
        }
    }
    

Building the Library

To build the library, navigate to the project directory and run the following command:

dotnet build --configuration Release

Packaging the Library

To create a NuGet package, use the following command:

dotnet pack --configuration Release

This will generate a .nupkg file in the bin/Release directory.

Publishing the Library

To publish the NuGet package, use the following command:

dotnet nuget push bin/Release/WhoIsChecker.1.0.0.nupkg --api-key YOUR_API_KEY --source https://api.nuget.org/v3/index.json

Replace YOUR_API_KEY wityh your actual NuGet API key.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

Acknowledgements

Special thanks to all the contributors and open-source projects that made this library possible.

Contact

For more information, please visit the project page.

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 netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.3 112 6/25/2024
1.0.2 101 6/25/2024
1.0.1 101 6/25/2024
1.0.0 86 6/25/2024