Adding /etc/hosts entry to host machine on vagrant up

The solution is to use vagrant-hostsupdater

vagrant plugin install vagrant-hostsupdater

This plugin adds an entry to your /etc/hosts file on the host system.

On up and reload commands, it tries to add the information, if its not
already existant in your hosts file. If it needs to be added, you will
be asked for an administrator password, since it uses sudo to edit the
file.

On halt, suspend and destroy, those entries will be removed again.

Leave a Comment

techhipbettruvabetnorabahisbahis forumu