title: VirtualBox guest cannot resolve host's name, but git can
body: <p>I have a Mac OS X machine running as VirtualBox host, and a Linux Mint guest. Using <code>Bridged Adapter</code>, both machines can access each other's network services.</p>
  
  <p>This is the setup:</p>
  
  <pre><code>Mac OS X     | hanxue-Mac.local    |   VirtualBox host  
  Linux Mint   |      mint15         |   VirtualBox guest
  </code></pre>
  
  <p>The host's network connection is mostly via Wifi, so both IP addresses are dynamic; especially the host. Since both machines have Samba and the naming daemon running, I would like to access the machines using hostnames, instead of IP address. This is verified by accessing the Samba shares on the Linux Mint guest from another physical machine on the same Wireless LAN. The following has been verified:</p>
  
  <ul>
  <li>Access web server on mint15 from hanxue-Mac</li>
  <li>Access web server on hanxue-Mac from mint15</li>
  <li>Internet access from mint15</li>
  <li>Access Samba file shares on mint15 from hanxue-Mac</li>
  <li>Access Samba file share on mint15 from a separate Windows machine in the same LAN</li>
  </ul>
  
  <p>Both Samba access uses the hostname, and not IP address. Looking up the VirtualBox host's hostname will fail in the guest (Linux Mint):</p>
  
  <pre><code>hanxue@mint15 ~ $ nslookup hanxue-Mac
  Server:     127.0.1.1
  Address:    127.0.1.1#53
  
  ** server can't find hanxue-Mac: NXDOMAIN
  
  hanxue@mint15 ~ $ nslookup hanxue-Mac.local
  Server:     127.0.1.1
  Address:    127.0.1.1#53
  
  ** server can't find hanxue-Mac.local: NXDOMAIN
  </code></pre>
  
  <p>But strangely, I can clone/pull git repositories from the VirtualBox host by using it's hostname:</p>
  
  <pre><code>mint15 $ git clone git@hanxue-Mac.local:hanxue-rti-scala.git
  Cloning into 'hanxue-rti-scala'...
  remote: Counting objects: 26, done.
  remote: Compressing objects: 100% (20/20), done.
  remote: Total 26 (delta 7), reused 0 (delta 0)
  Receiving objects: 100% (26/26), 10.09 KiB, done.
  Resolving deltas: 100% (7/7), done.
  </code></pre>
  
  <p>I have verified that there is no <code>~/.gitconfig</code> or <code>/etc/gitconfig</code> and nothing in <code>~/.ssh/known_hosts</code> that contain the VirtualBox host's hostname. Certainly nothing in <code>/etc/hosts</code> too. </p>
  
  <p>How can git resolve the hostname and how can I get the guest VM to resolve host VM's hostname without resorting  to manually keying in the IP address/hostname to <code>/etc/hosts</code> every time?</p>