htb_hosts_add
Add or update Hack The Box host entries in /etc/hosts without sudo so hostnames resolve to box IPs. Group entries in a managed block for later cleanup.
Instructions
Add or update an HTB host entry in /etc/hosts (no sudo needed). Use this whenever you need a hostname like machine.htb to resolve to a box IP. Entries go in a managed block and can be cleaned later.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | Yes | Box IP, e.g. 10.129.45.2 | |
| tag | No | Optional group tag (defaults to the box name) for bulk cleanup | |
| hostnames | Yes | One or more hostnames, e.g. ['machine.htb','www.machine.htb']. A single comma/space separated string also works. |