title: Can Multiple Vagrant VMs communicate by VM hostname?
body: <p>I am managing multiple VMs with Vagrant. Networks are configured as private, ip addresses have been set and hostnames are assigned. As shown in the Vagrantfile below.</p>
  
  <p>The VMs can communicate with each other via the IP address, but I would like to know how to allow VMs to communicate using their assigned hostname. I.e. How to make <code>ping comtest2</code> work from <code>comtest1</code>?</p>
  
  <p>Vagrantfile:</p>
  
  <pre><code>Vagrant.configure("2") do |config|
  
    config.vm.define "comtest1" do |comtest1|
      comtest1.vm.box = "precise32"
      comtest1.vm.hostname = "comtest1"
      comtest1.vm.network "private_network", ip: "192.168.10.21"
    end
  
    config.vm.define "comtest2" do |comtest2|
      comtest2.vm.box = "precise32"
      comtest2.vm.hostname = "comtest2"
      comtest2.vm.network "private_network", ip: "192.168.10.22"
    end
  
  end
  </code></pre>