Ping Ubuntu by hostname in a Windows machine

18,767

Solution 1

Not sure why Ubuntu is different but this works with debian:

Install debian using bridged networking

Install Samba

As soon as Samba is installed and running the guest machine can be pinged by hostname. I'm using a Windows 7 host and a Debian 7 LXDE guest.

Solution 2

If you have any apple device and, as such, installed iTunes on your windows PC, you have this little thing called a mDNS responder installed on windows. Ubuntu also has one (Avahi) which is free, opensource, lennartful and more importantly: installed by default. Your windows should then be able to resolve your Ubuntu hostname provided you end it with .local, e.g. ubuntu.local if your hostname is ubuntu. The name resolution happens using multicast DNS, which uses UDP on port 5353 and group 224.0.0.251.

Ubuntu should also be able to see your Windows that way (try avahi-browse -a or avahi-discover)

Share:
18,767
Blnukem
Author by

Blnukem

A previous script kiddie, now a drawer of boxes and arrows.

Updated on September 18, 2022

Comments

  • Blnukem
    Blnukem over 1 year

    I installed Ubuntu 12.04 on a Virtual Machine (Virtualbox). The network adapter is attached using bridged adapter.

    I can ping the guest OS by IP but I can't ping it via hostname.

    I already installed Samba and winbind. I also edited /etc/nsswitch.conf to and 'wins'.

    Does the settings takes time to take into effect? What other things can I try to be able to ping the Ubuntu OS by hostname?

    Thanks!

  • detly
    detly over 10 years
    Just a note for anyone else who beat their heads against this: Avahi won't work between subnets, and it's common in corporate networks to have wireless/ethernet on separate subnets.