What are some solutions to access Windows by its computer name from Linux and Mac using TCP/IP. That is, from terminal I want to be able to ping my Windows PCs using its host name.

My setup is:

  • Various machines running Ubuntu, Windows XP and OS X.
  • Networked using a consumer grade wireless router which provides DHCP.
  • The only DNS is the ISP's, which resolves Internet names and not local host names.

The Windows machines can ping each other by name. The Ubuntu and OS X machines can only ping Windows by IP address (name doesn't work).


I ended up going with multicast DNS by installing Apple's Bonjour. Now I can address the Windows PCs by using the address hostname.local from the OS X and Linux machines.


you can edit your /etc/hosts file to add the ip addresses to internal DNS support.

Obviously a sync solution (meaning using a DNS server in your router or setting up a DNS server on one of your boxes that the router points to)


Check to see if your router supports DNS forwarding. Often DNS forwarders will serve windows hostnames if they come through as a DNS request.

You might also make sure that Samba is fully installed on the linux machines and enabled on the Mac.

  • DNS Forwarding is a feature that allows DNS requests to be forwarded to a specific set of downstream servers rather than using root hints for unresolvable names. It doesn't have anything to do with local hostnames. – MDMarra Jun 7 '10 at 2:06

Adding wins to the end of the hosts line in the file /etc/nsswitch.conf will make Linux use the Windows network browsing thingy for name resolution.

(You will need to have the winbind package installed for it to work. It will probably already be installed.)

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.