Can't ping by hostname of CentOS running on VM from Windows, but can from Mac
Solution 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.
Solution 2
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.
Related videos on Youtube
Comments
-
Zack The Human over 1 year
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: friendFrom 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 over 14 yearsThanks for the suggestion, I updated the original question with the nslookup results.
-
prestomation over 14 yearsPlease try to avoid using WINS, do the world a favor.
-
Zack The Human over 14 yearsThis 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 over 14 yearsIf I disable WINS, what do I use as an alternative?
-
Brian C. Lane over 14 yearsOk, 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.
-
Zack The Human over 14 yearsSo, 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.
-
CarlF over 14 yearsSamba has nothing to do with the question, which is about getting the hostname of a real XP box recognized.
-
Neal over 14 yearsnmbd 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 over 14 yearsIn 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.
-
prestomation over 14 yearsFrom 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?
-
Zack The Human over 14 yearsInstalling 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 over 14 yearsBrian, 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.