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 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:// 192.168.1.5

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.

share|improve this question

migrated from serverfault.com Nov 6 '11 at 15:12

This question came from our site for professional system and network administrators.

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

4 Answers 4

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:

192.168.1.5 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.

EDIT

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.

share|improve this answer
    
But I can access my ubuntu server by just using hostname. And this is happening without DNS server. –  Future King 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. –  Future King Nov 6 '11 at 16:59
1  
@Future: Make sure you have nmbd actually running on SuSE and not blocked by the firewall. –  grawity Nov 6 '11 at 18:00

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

share|improve this answer
2  
network adapters are in bridged mode –  Future King Nov 6 '11 at 17: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.

share|improve this answer

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.

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.