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
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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package ppech.dotnet.hostsctl --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
hostsctl
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
listlist the entries in the hosts filebackupbackups the hosts filerestorerestores the hosts file from a backupadd <hostname>adds entry to the hosts fileremove <hostname>removes entry from hosts fileenable <hostname>enables entry in hosts filedisable <hostname>disables entry in hosts fileexists <hostname>checks if entry exists in hosts fileopenopens hosts file (using shell execute) - Windows onlytemplatenewcreates a new template filelistlist the entries in the template fileadd <hostname>adds entry to the template fileremove <hostname>removes entry from template fileapplyapplies 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 | Versions 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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.
This package has no dependencies.