Vagrant - access guest from host via hostname [closed]

Why not also specify a private network that your host can use to connect to the VM?

http://docs.vagrantup.com/v2/networking/private_network.html

The private IP will stay the same wherever you go. You could then add a hosts entry for this private IP.


Following Andy's advise, I created a private network with a static IP address. Then in the Windows host, I configured hostname with that IP address. This way, I am able to access the webserver from local/host OS.

Now, in VagrantFile, as my host computer's port 88 is forwarded to guest's 80(config.vm.network :forwarded_port, guest: 80, host: 88), I can access webserver from local LAN computers with: http://host-computer-name:88/.