https://github.com/ppech/dotnet-hostsctl
Easily manage the hosts file using the .net command-line tool
https://github.com/ppech/dotnet-hostsctl
cli dotnet hosts hosts-file hostsfile tool
Last synced: 5 months ago
JSON representation
Easily manage the hosts file using the .net command-line tool
- Host: GitHub
- URL: https://github.com/ppech/dotnet-hostsctl
- Owner: ppech
- License: mit
- Created: 2024-05-24T04:32:47.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-01-01T09:59:08.000Z (over 1 year ago)
- Last Synced: 2025-04-02T15:16:14.250Z (about 1 year ago)
- Topics: cli, dotnet, hosts, hosts-file, hostsfile, tool
- Language: C#
- Homepage:
- Size: 54.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `hostsctl`
[](https://www.nuget.org/packages/ppech.dotnet.hostsctl/)
[](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
- [Features](#features)
- [Commands](#commands)
- [Options](#options)
- [Installation](#installation)
- [Build with](#build-with)
- [License](#license)
## Commands
* `list` list the entries in the hosts file
* `backup` backups the hosts file
* `restore` restores the hosts file from a backup
* `add ` adds entry to the hosts file
* `remove ` removes entry from hosts file
* `enable ` enables entry in hosts file
* `disable ` disables entry in hosts file
* `exists ` 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 ` adds entry to the template file
* `remove ` removes entry from template file
* `apply` applies the template file to the hosts file
## Options
* `-i|--input `: path of input file, default value depends on operating system
* `-o|--output `: path of output file, default value is same as input file
* `-t|--template `: path of template file, default value is hosts.ht in working directory
* `-j|--json`: output as JSON
* ``: 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
* https://github.com/spectreconsole/spectre.console
## License
This project is licensed under the [MIT License](LICENSE).