A zsh plugin for quickly switch hostfile and refresh dns cache
- Download this plugin and place it in
path-to-zsh/custom/plugin
- Activate the plugin by adding
host-switchinpluginsin your config file
-
Setup hostfiles
-
Be advised, before setting up this plugin, remember to backup your original file
/etc/hostsas you might already add a few custom host setting into you hosts file. This plugin works as a tiny tool to help you switch between several hosts files. -
Add host file to be switched in
hostfilefolder, and rename the file likehosts.dev. Switching current hosts file tohosts.devreqires this command. Filename extension was used as the arguments to match files.
hostswitch dev
- Use
hoststatusto check which host script is being used currently. - Changes might take effect in several minutes so you might need to reset your DNS cache.
-