I have the following scenario: A host machine (OS X) and a guest machine (Ubuntu). The guest is running through Virtual Box, and the network configurations is set to "Bridged adapter". Both machines have a hostname, host.local for the host, and guest.local for the guest. They can communicate with each other using the hostnames, e.g.
I'd like to use the guest machine as a development server for websites. The sites will be located on the host, and are accessible to the guest using a shared folder. I've configured Apache to use a virtual document root, which will make the sites available on site.guest.local. However, this would require me to setup site.guest.local, site2.guest.local etc in my hosts file, pointing to the IP of the guest.
I don't want to depend on the IP address of the guest, since the computer might be connected to different networks, with a different IP address from time to time.
I've been fiddling around with a local DNS server, specifically DNSMasq, trying to create CNAME records etc, but I can't figure out the proper way to achieve this.
In short terms, I want to create a local alias that points to guest.local.