ppech.dotnet.hostsctl 1.1.0

dotnet tool install --global ppech.dotnet.hostsctl --version 1.1.0                
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local ppech.dotnet.hostsctl --version 1.1.0                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=ppech.dotnet.hostsctl&version=1.1.0                
nuke :add-package ppech.dotnet.hostsctl --version 1.1.0                

hostsctl

NuGet License

hostsctl is a command-line tool for managing your system's hosts file. It provides commands for:

  • list entries
  • exists of entry
  • add, remove, enable, and disable entries
  • backup and restore hosts file

With the ability to use a template file to save entries within your project.

With options you can specify:

  • specify a custom input/output file
  • use JSON output format

Table of Contents

Commands

  • list list the entries in the hosts file
  • backup backups the hosts file
  • restore restores the hosts file from a backup
  • add <hostname> adds entry to the hosts file
  • remove <hostname> removes entry from hosts file
  • enable <hostname> enables entry in hosts file
  • disable <hostname> disables entry in hosts file
  • exists <hostname> checks if entry exists in hosts file
  • open opens hosts file (using shell execute) - Windows only
  • template
    • new creates a new template file
    • list list the entries in the template file
    • add <hostname> adds entry to the template file
    • remove <hostname> removes entry from template file
    • apply applies the template file to the hosts file

Options

  • -i|--input <file>: path of input file, default value depends on operating system
  • -o|--output <file>: path of output file, default value is same as input file
  • -t|--template <template>: path of template file, default value is hosts.ht in working directory
  • -j|--json: output as JSON
  • <hostname>: host name, ex. app.mydomain.local
  • [ip]: ip address, default is 127.0.0.1

Installation

You can install it using the dotnet tool install ppech.dotnet.hostsctl --global command.

To update dotnet.hostsctl to the latest version, use the dotnet tool update command.

Build with

License

This project is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
1.1.0 136 9/14/2024
1.0.0 129 5/30/2024