Can't ping by hostname of CentOS running on VM from Windows, but can from Mac

1

1

I have an instance of CentOS running in VMware on a Windows Server 2003 machine on my home network.

CentOS hostname: varia
Windows XP hostname: friend

From my Windows XP machine I am unable to ping the CentOS instance by its hostname. I can only ping it by IP address.

From my Mac I am able to ping the CentOS instance by its hostname.

From the CentOS instance I can ping my Windows XP machine.

What I have tried so far:

  • The firewall on my Windows XP machine it turned off.
  • There is no entry for this host in my hosts file.
  • I ran ipconfig /flushdns on friend.

When I attempt to ping the CentOS instance I receive the following error:

C:\Documents and Settings\Zachary>ping varia
Ping request could not find host varia. Please check the name and try again.

Update: nslookup varia results:

C:\Documents and Settings\Zachary>nslookup varia
*** Can't find server name for address 192.168.1.1: Non-existent domain
*** Default servers are not available
Server:  UnKnown
Address:  192.168.1.1

Name:    varia
Address:  192.168.1.149

The resulting ip address is correct: 192.168.1.149 but pinging is still not possible.

Zack The Human

Posted 2009-10-23T02:48:26.583

Reputation: 125

Answers

1

You need to ensure that Samba, the Linux implementation of Windows' networky stuff, is properly configured and running.

Can you check whether nmbd (part of Samba) is running on the CentOS machine?

In a terminal, the command ps -A will give you a list of running processes.

Also have a look at /etc/samba/smb.conf to make sure it all looks sensible.

Here is a page about setting up name resolution in a mixed environment.

Neal

Posted 2009-10-23T02:48:26.583

Reputation: 8 447

So, samba wasn't installed. I installed it via "yum install samba" and set my workgroup in smb.conf. I think that's progress but it hasn't yet solved my problem. Brian brings up a good point about my lack of a DNS server so I will try to resolve that first. – Zack The Human – 2009-10-23T04:36:37.070

Samba has nothing to do with the question, which is about getting the hostname of a real XP box recognized. – CarlF – 2009-10-23T04:38:11.857

nmbd is part of the samba suite and it is used for NetbIOS in Linux. Therefore if Zack is using NetBIOS/WINS (and if he wasn't he'd know it) Samba is relevant.

Whether NetBIOS/WINS should be used is a separate issue. – Neal – 2009-10-23T09:08:55.663

In this case Zack has a working home network (presumably a small number of machines), to which he is adding a Virtual Machine. The VM is having trouble joining the existing infrastructure.

The broadcast messages and browser elections are not exactly going to swamp the network: therefore I think that in this case the VM should fit in with the rest of the system.

I am not saying that WINS is a good system, and would definitely not use it in a proper network, but I think its use is probably ok in this situation. – Neal – 2009-10-23T09:11:17.937

Installing samba seems to have done the trick. I also took Brian's advice and explored some of the DNS settings of my router, adding a a domain name. I am able to ping varia from friend now. Thanks very much! – Zack The Human – 2009-10-23T16:09:08.953

1

How is your DNS setup?

On your Mac is there a search domain set in /etc/resolv.conf?

Normally you have a domain in addition to the hostname. The search option will set that so that it will append the default domain to a bare hostname. I'm not sure that's how it works in windows, but that's how Linux and Mac do it.

For example, inside my LAN I use .home as the domain and run a local DNS server that intercepts all .home requests and maps them to local IPs. My /etc/resolv.conf files have search home in them.

Brian C. Lane

Posted 2009-10-23T02:48:26.583

Reputation: 145

Almost has to be this, what is the FQDN for all the machines? – prestomation – 2009-10-23T03:54:52.753

This is on my home network and I do not have a domain controller (as far as I know). I have three WRT54G routers conntected to each other through the house. Only one of the routers has DHCP enabled as the other routers serve as wireless access points. Could there be a domain I don't know about? – Zack The Human – 2009-10-23T04:01:47.187

Ok, that's why you can't ping. You haven't setup DNS. The samba answer may work for you, but really, you should be using DNS style domains not the abomination that Windows tried to create. – Brian C. Lane – 2009-10-23T04:16:55.720

1Brian, thank you for your advice. I added a domain name in my router's DNS settings and can ping all of my home PCs using that domain name as a suffix. – Zack The Human – 2009-10-23T16:11:01.790

0

Windows and Linux operating systems work differently with regards to DNS. With DHCP I believe Windows uses WINS and will not recognize the new Linux node. You can add it to your hosts file on Windows if you want or add the IPs to DNS. Also are you sure the machines are on the same subnet? Give nslookupa try.

John T

Posted 2009-10-23T02:48:26.583

Reputation: 149 037

Thanks for the suggestion, I updated the original question with the nslookup results. – Zack The Human – 2009-10-23T03:13:34.810

1Please try to avoid using WINS, do the world a favor. – prestomation – 2009-10-23T03:54:16.343

If I disable WINS, what do I use as an alternative? – Zack The Human – 2009-10-23T04:02:49.430

From you Question: Server: UnKnown Address: 192.168.1.1

From other comments it looks like this is a WRT54G which I don't believe updates its DNS from DHCP, but it looks like its returning the correct name of your server. Are you running stock firmware on the router? – prestomation – 2009-10-23T15:03:33.897