https://github.com/at0mxploit/hostfile
Annoying to add hostfile everytime.
https://github.com/at0mxploit/hostfile
Last synced: 11 months ago
JSON representation
Annoying to add hostfile everytime.
- Host: GitHub
- URL: https://github.com/at0mxploit/hostfile
- Owner: At0mXploit
- Created: 2025-07-26T16:03:37.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-07-26T16:05:15.000Z (12 months ago)
- Last Synced: 2025-08-03T08:22:55.694Z (11 months ago)
- Language: Shell
- Size: 3.91 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hostfile
Annoying to add hostfile everytime.
## Usage:
```bash
$ hostfile
Usage:
hostfile [--linux|--windows] [SHORTNAME]
Adds or updates an entry in the hosts file.
hostfile [--linux|--windows] -R
Removes any entry containing the specified domain or hostname.
hostfile --setup
Installs this script to /usr/bin/hostfile with proper permissions (requires sudo).
hostfile -h | --help
Show this help message.
Examples:
# Add AD box entry on Linux (with shortname):
./hostfile.sh --linux 10.10.10.5 dc.htb.local dc
# Add normal Linux box entry (no shortname):
./hostfile.sh --linux 10.10.10.10 hack.htb
# Add Windows hosts entry (via WSL):
./hostfile.sh --windows 10.10.10.10 hack.htb
# Remove entry by domain or shortname:
./hostfile.sh --linux -R hack.htb
./hostfile.sh --linux -R dc
# Setup the script (move to /usr/bin and set permissions):
sudo ./hostfile.sh --setup
```