Skip to content

Manage /etc/hosts with Python3 faster than lightning ⚡ ✨

Notifications You must be signed in to change notification settings

dunderrrrrr/hostf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hostf

Sometimes you need to manage your hosts file /etc/hosts.
Some do it on a daily basis.

This Python script will do it for you faster than lightning ⚡ ✨

Installing

Clone and cd into dir.

$ git clone [email protected]:dunderrrrrr/hostf.git && cd hostf/

Add to ~/.bashrc.

alias hostf='sudo /usr/bin/python3 /home/user/path/hostf/hostf.py'

Reload shell or restart terminal.

$ source ~/.bashrc

Usage

Add / delete / show records

$ hostf -a 10.1.1.50 example.com
$ hostf -d 10.1.1.50
$ hostf
127.0.0.1   localhost
10.1.1.5    test-serv
10.10.1.7   example.com

Help

$ hostf -h
usage:
[ADD] hostf -a <ip> <hostname>
[DEL] hostf -d <ip>

hostf will manage /etc/hosts faster than lightning.

optional arguments:
  -h, --help            show this help message and exit
  -a 10.1.1.5 test.com  Add to hosts.
  -d 10.1.1.5           Delete from hosts.

About

Manage /etc/hosts with Python3 faster than lightning ⚡ ✨

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages