3
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. ping host.local
.
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.
I've managed to solve my problem with a workaround. I've setup my guest to use two network interfaces, one bridged, and one host only. The host only will have e static IP and will only be able to communicate with the host, and the bridged will have access to the outside world. Using the static IP, I'm able to use DNSMasq to create an address that points to the guest. – Olof Johansson – 2013-01-03T12:19:01.720
If you would like, you can answer your own question without any problem. Cheers! – Karolinger – 2013-01-08T01:41:42.887
Yeah I know, but I don't consider my solution as the answer to my original question, as it's a simple workaround :) – Olof Johansson – 2013-01-08T10:06:27.810