I currently have a set up on my development computer that uses apache and the hosts file to point to different folders. I's worked great but I've just discovered vagrant. The only problem with using vagrant is I seem to loose all the ability to use internal domains.

Currently I'm using the hosts file for something like this:

  • main.dev -> localhost -> /local/www/main/

  • *.dev -> localhost -> /local/www/main/

  • staging.dev -> staging server

Is there anyway of mapping those domains to my vagrant box for a particular app instead of having to go to localhost:3000?


You can continue to use your hosts file. Let's say you assigned your Vagrant VM the IP address Whereas before your hosts file might have been main.dev staging.dev

Now it would be main.dev staging.dev

However, instead of editing your hosts file manually, there are vagrant plugins that will either edit your hosts file for you or run a local DNS server. Take a look at vagrant-dns and vagrant-hostmaster.


Apache reverse proxy on your dev computer. You'll practically map localhost:3000 to localhost/onesite.


You can use bridge networking for guest.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.