I’ve been using Vagrant for a several years now and love it. One of my few complaints was that each time I wanted to create a new machine I would need to edit my
/etc/hosts file. Then I found the excellent Vagrant plugin named Landrush.
My hosts file went from this:
How to Install Landrush
Installing and using Landrush is really easy.
Step 1: Install the plugin
vagrant plugin install Landrush
Step 2: Add the Landrush configuration to your Vagrantfile
config.vm.hostname = "project1.vagrant.dev" # if not set yet
config.landrush.enabled = true
There are more options you can add which can be found here.
If you don’t want to use the TLD of
vagrant.dev you can change it but keep it mind it will override that TLD on your computer. If you set your box’s hostname to
something.google.com and set
landrush.tld = google.com your searches won’t work very well unless you use Bing…nevermind, your searches still won’t work very well.
Step 3: Start up your vagrant box
That’s it. Landrush does everything else for you.
Test your box,
project1.vagrant.dev should be pointing to the IP address of your vagrant box.