Hosts Issue

How do I add an entry to my /etc/hosts file?

Adding an entry to your hosts file will allow you to access your website in the virtual machine by a url. For example you can add an entry for which would try to connect to your virtual machine IP.

For our first entry lets try getting to work with the default protobox configuration. Open up your terminal app and type sudo nano /etc/hosts. Paste the following entry below into the file. Note: you may have to type your system password to access the file.

Now press ctrl+o to write to the file and ctrl+x to exit. Thats it! If your vagrant machine is running you should now be able to access in your web browser.

You will need to repeat this process for each virtual host that you have setup for apache or nginx. The IP address will be the one you picked in the Vagrant section of the website. The domain is what you picked during the Server Name section of apache or nginx configurations.