Posts tagged hosts

Hostr – A simple PHP CLI tool to manage your hosts file!

Hi everyone! A few hours ago I release on Github my latest version of Hostr, a PHP CLI tool that you can use to manage your hosts file with an expressive and easy syntax.

Before you say it: yes, I know that out, into the wild, there are many other similar tools. However, I wanted to do some practice with the Symfony Console component and, later, with the Box2 tool that I used to create the .phar file.

That’s all. It took me, in total, three/four days of work. And it was really funny.

Cool! How can I try it?

Great! All you have to do is open your terminal, switch to sudo and type the following instructions:

chmod 755 hostr.phar && mv hostr.phar /usr/local/bin/hostr

The first line will download in the current folder the .phar file.

The next line will change the file permissions to 755 and move it in the /usr/local/bin folder

Done. How can I use it?

Well, now that you have installed it, type


to verify if it was installed successfully.

Now you can use every single command. There are, actually, 7 commands that you can use.

  • show
  • add
  • remove
  • backup
  • restore
  • tidy
  • check

For more details, Take a look to the project page on Github!