Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have my development server on a locally hosted virtual machine. The VM is running Ubuntu and the host is Windows 8. I have samba installed on the VM, so I can access it by hostname. Everything works great, except for the fact that I would like to start testing subdomains in my project.

Apache config which I believe is appropriate for what I'm trying to do:

<VirtualHost *:80>
        ServerName foo
        ServerAlias *.foo

        DocumentRoot /home/foo/sites/foo/www

        <Directory /home/foo/sites/foo>
                Options Indexes FollowSymLinks
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>

Now, I know that I can do something similar by adding entries into /etc/hosts on the VM, or by using something like dnsmasq. However, with either of those methods, the subdomains do not get carried over to the host, ie. I cannot enter en.foo on my Windows 8 machine and see the same thing I see when I enter just foo.

Is it possible to accomplish this without having to resort to a DNS proxy, and setting my Windows machines' DNS address to that of the proxy?

share|improve this question

1 Answer 1

You need to add the hosts file entries into your Windows 8 machine so that your web browser can send them through HTTP to your VM.

The file has the same format as on Unix-based systems, and can be found at C:\Windows\system32\drivers\etc\hosts

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.