Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

The server: Ubuntu 10.10 Server as guest in a VirtualBox (IP 192.168.178.91).

Simple Question: I want to access a virtual host named 'example.server' from outside my virtual box by simply using a browser and an address like http://example.server. The whole thing should be realized by using DNSMasq.
Thx. :)

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

First, you configure Virtualbox to use bridged networking

bridge

Next you install dnsmasq on your dns server. I assume this is Ubuntu with an ip address of 192.168.178.10 , adjust accordingly

sudo apt-get install dnsmasq

You then add your virtualbox server into /etc/hosts on the dns (dnsmasq) server

# Graphical
gksu gedit /etc/hosts

# Command line
sudo -e /etc/hosts

Add in your server

192.168.178.91 example.server www.example.server

You then point your clients to use your dns (dnsmasq) server for dns. You can do this with network manager, put 192.168.178.10 in as the dns server.

dns

share|improve this answer
    
Yap, my problem was, that I pointet to 127.0.0.1 in my /etc/hosts file, not 192.168.178.91. Formerly, I had a webserver directly on my pc - not virtualized via VirtualBox and there it was correct. Thanks for your help! :) –  Boris Karl Schlein Mar 12 '12 at 19:43
add comment

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.