Multiple virtual hosts - This site can’t be reached Vagrant/Virtualbox

I'm having problem setting multiple virtual domains. Tried so many solutions, nothing worked. I'm just missing something but have no clue what. It's been frustrating journey say the least. I have set up 2 virtual boxes: one for Laravel environment and one for Magento environment. They both have the same problem, domain doesn't work. Here is for magento:

  • Folder: magento
  • Virtual domain:
  • magento.conf
  • ip:

When I enter in browser it runs fine, but if I enter it states:

This site can’t be reached’s server DNS address could not be found.

For Laravel is the same.

Magento virtualbox

#!/usr/bin/env bash

# Ubuntu 15.10 (GNU/Linux 4.2.0-34-generic x86_64) / ubuntu/wily64

# Update Ubuntu
# apt-get update

# Apache
echo "----- Provision: Installing apache..."
# apt-get install -y apache2 apache2-utils

echo "ServerName localhost" > "/etc/apache2/conf-available/fqdn.conf"
a2enconf fqdn
a2enmod rewrite
a2dissite 000-default.conf

# Folders
echo "----- Provision: Setup /var/www to point to /vagrant ..."
rm -rf /var/www
ln -fs /vagrant /var/www

# Apache / Virtual Host Setup
 echo "----- Provision: Install Host File..."
 cp /vagrant/vm_provision/hostfile /etc/apache2/sites-available/magento.conf
 a2ensite magento.conf

# Cleanup
apt-get -y autoremove

# Restart Apache
echo "----- Provision: Restarting Apache..."
service apache2 restart


 Vagrant.configure(2) do |config| = "ubuntu/wily64"

        config.vm.provision :shell, :path => "vm_provision/" "private_network", ip: "",

        group: "www-data", 
        mount_options:["dmode=770, fmode=660"]

      # VirtualBox specific settings

      config.vm.provider "virtualbox" do |vb|
        vb.gui = false
        vb.memory = "2048"
        vb.cpus = 1

apache my.conf

<VirtualHost *:80>


        DocumentRoot /var/www/magento

        # Custom log file locations
        LogLevel warn
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # Allow overrides in .htaccess file
        <Directory /var/www/>
                Options FollowSymLinks
                AllowOverride All


In hosts file:

# Copyright (c) 1993-2009 Microsoft Corp.
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
# For example:
#          # source server
#              # x client host

# localhost name resolution is handled within DNS itself.       localhost


To be able to enter or any other LOCAL domain (eg. not available on the external internet) you need to modify the "hosts" file on the machine running the browser. In this case, your host (not inside your vagrant machine). The process varies depending on if you're running Windows/OSX/Linux/etc., but here is a quick overview from Wikipedia.

The three you probably care about:







In that file, you will need to add the following line to let your OS know that means look at

Note you may need to restart in order for this to take effect. Also note that you will need admin/sudo privileges in order to edit this file.

Need Your Help

git, how to overwrite commits


I messed up my app and winded up doing a

Are there any existing tools to convert c++ header files to header + implementation?

c++ header-files

I tend to prototype C++ classes as a self-contained class, i.e. like: