Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
rcaught committed Feb 21, 2021
1 parent 193e5bb commit 6d18160
Showing 1 changed file with 25 additions and 13 deletions.
38 changes: 25 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,34 @@ $ unzip /tmp/hosts-override.zip -d /usr/local/bin
```
##### Windows (untested)
- Download https://github.com/rcaught/hosts-override/releases/latest/download/windows.zip
- Unzip the file and run the bin as Administrator
- Unzip the file and run the exe as Administrator

## Usage (Mac / Linux)
```
$ # Override myhost.com to resolve to 127.0.0.1
$ sudo hosts-override myhost.com,127.0.0.1
$ # google.com will be resolved into an IP / set of IPs
$ sudo hosts-override myhost.com,google.com
$ # Multiple hosts and values are supported
$ sudo hosts-override myhost.com,127.0.0.1 anotherhost.com,127.0.0.1
$ # Refresh of unresolved hosts (with custom interval)
$ sudo hosts-override -r -i=1m myhost.com,127.0.0.1
```
## Usage
### Mac / Linux
- Override myhost.com to resolve to 127.0.0.1
```
$ sudo hosts-override myhost.com,127.0.0.1
```
- google.com will be resolved into an IP / set of IPs
```
$ sudo hosts-override myhost.com,google.com
```
- Multiple hosts and values are supported
```
$ sudo hosts-override myhost.com,127.0.0.1 anotherhost.com,127.0.0.1
```
- Refresh of unresolved hosts (with custom interval)
```
$ sudo hosts-override -r -i=1m myhost.com,127.0.0.1
```
### Windows
- Run Command Prompt as Administrator and navigate to the directory containing hosts-override.exe
- ```
hosts-override.exe myhost.com,127.0.0.1
```

### Notes
- `sudo` is required as the hosts file is owned by `root`
- `sudo` or running as Administrator is required as the hosts file is owned by `root`
- On exiting the program with an interupt (CTRL-c), the hosts file is cleaned of appended records
- In the case of an unclean shutdown, the next invocation of `hosts-override` will clear the previous sessions records
- IPv4 and IPv6 addresses supported

0 comments on commit 6d18160

Please sign in to comment.