I have two Linux servers on VirtualBox Virtual machines. One is Ubuntu Linux and another is OpenSuse Linux.

The hostname of Ubuntu server is "ubuntu-server" and hostname of open suse server is "suse-server".

When I type http:// ubuntu-server from my host machine it works perfectly. But when I type http:// suse-server from my host machine it doesn't work. To access suse apache I have to type its IP adress eg: http://

I checked my "hosts" file and it doesn't has any entry for ubuntu-server.

How can access SUSE server's Apache without typing its IP address and without editing hosts file in host machine?

My host OS is Windows 7 Professional.

  • Sounds like the suse server may not have a hostname. What does hostname return?
    – iainlbc
    Nov 6 '11 at 18:15

Put your network adapters into Bridged mode so it gets its own address from the router

In Virtual Machine's settings, select Networking->Adapter *x*->Bridged Mode->OK

  • 2
    network adapters are in bridged mode Nov 6 '11 at 17:00

In order it to work the way you want to, you have two options: Set up a DNS server on your network to route requests to suse-server to the IP, or you can add an entry in your ubuntu servers /etc/hosts file for the SUSE machine. I won't get into the DNS server setup, but the hosts file method is really simple. Just add the following line to the file on your Ubuntu box: suse-server.localdomain suse-server

Change the IP and hostname as you desire, but that should work.

You could also do the same on your SUSE machine just add the following to its hosts file:

192.168.1.x ubuntu-server.localdomain ubuntu-server

Once again, modify the IP and hostname to taste.


Sorry, I didn't see that you didn't want to edit the hosts file. Seeing as that's the case. A DNS server is the only option that I know of. I think some routers may provide their own. I would look into that first.

  • But I can access my ubuntu server by just using hostname. And this is happening without DNS server. Nov 6 '11 at 16:58
  • I have installed SAMBA in both ubuntu and suse server. From Windows Host machine I can access ubuntu server by just typing \\UBUNTU-SERVER in Windows explorer. But for suse server I have to type its IP address. Nov 6 '11 at 16:59
  • 1
    @Future: Make sure you have nmbd actually running on SuSE and not blocked by the firewall.
    – user1686
    Nov 6 '11 at 18:00

If you can hit Ubuntu-server without DNS (since there is no formal DNS server) from Windows then it sounds like WINS maybe doing the resolving and Ubuntu registered correctly with whoever the master browser is. If you are using DHCP, your router may be handling it incorrectly? There could be DHCP registration issues from the router to the machine.


One possible cause is that the DHCP client on SUSE does not send the host name during negotiation. If the network is managed by NetworkManager, try changing the setting from GUI, or just edit /etc/dhclient-eth0.conf. If NeworkManager isn't installed, try /etc/dhclient.conf, without the "ethx" suffix.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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