I have a Ubuntu desktop PC and a Windows 7 laptop. They have network connection over a wifi router, which gives them local IP addresses. Both computers see each other when pinged by IP. The Ubuntu pc can ping the Windows machine by hostname, but the Windows laptop can't ping the Ubuntu PC.

It looks like this is a common problem with a well-known solution, as seen from this question: Access server by host name?, as well as some duplicates. However, the solution there is "install avahi". I have avahi running, and it does not help for me. I have no idea how to troubleshoot from here.

From the Ubuntu PC:

rumtscho@bradbury:~$ sudo service avahi-daemon restart
[sudo] password for rumtscho: 
avahi-daemon start/running, process 3019

and then on the Windows laptop:

C:\Users\rumtscho>ping bradbury.local 
Ping-Anforderung konnte Host "bradbury" nicht finden. Überprüfen Sie den Namen, 
und versuchen Sie es erneut. 

which means, roughly, "hostname not found".

I didn't find anything suspicious in avahi.conf. Here are the working lines of the file (everything else is commented out):




I tried both pinging bradbury and bradbury.local. I also tried uncommenting the line publish-addresses=yes in the conf file. Both didn't work.

Any ideas what I am doing wrong? How can I find it out, what are my options?

Update I was told in chat that the Windows PC needs a "multicast DNS resolver", so I installed Bonjour. Now the error message is different:

Ping wird ausgeführt für bradbury.local [*IPv6 address edited out*] mit 32 Byt
es Daten: 
Zielhost nicht erreichbar. 
Zielhost nicht erreichbar. 
Zielhost nicht erreichbar. 
Zielhost nicht erreichbar. 

Ping-Statistik für *IPv6 address edited out*: 
    Pakete: Gesendet = 4, Empfangen = 0, Verloren = 4
    <100% Verlust>,

"Zielhost nicht erreichbar" means "cannot reach target host", and there is 100% packet loss. So what should I do to make the Ubuntu PC reachable

3 Answers 3


Avahi is a zeroconf/bonjour DNS responder, which is not available per default on Windows since its an Apple invention. It may help if you install 'Bonjour for Windows' on the W 7 machine.

If you don't like this, the Windows laptop can resolve your linux desktop if the desktop runs samba, the nmbd daemon there will advertise the hostname and the corresponding IP-Address by means of NetBIOS over TCP/IP, which is just a checkbox somewhere in the Windows networking preferences.

The router may do IPV4 only, perhaps disable IPV6 on both, reboot Windows, retry. Also, avahi may not pick up config changes immediately, do a restart avahi as root.

  • 1
    I did install Bonjour on the same evening, see the question. I'll look into the IPv6 matter, the only other thing I've tried it is to talk to bradbury by IPv4 address and it went well.
    – rumtscho
    Sep 26, 2011 at 20:45

On your Win 7 laptop open up the hosts file located in C:\Windows\System32\drivers\etc\hosts and add the ip address and hostname of your Ubuntu machine.

For example:      bradbury

Not sure if you have to reboot or not but that should resolve the hostname of your ubuntu machine to the ip address

  • 1
    Sorry, I forgot to describe this completely, because I assumed everybody knew how these routers work. They assign a dynamic IP everytime a machine connects to the network, so the hostfile can be obsolete on the next reboot. Plus, I take the laptop around with me, and use it to log in in different networks.
    – rumtscho
    Sep 24, 2011 at 17:19

I don't think you can solve your problem in this way. In order to solve your problem you must have a local dns server set up on one of your computers, or your wifi router. The other way is what Rapture sugested and set your wifi router to give you the same ip's (most wifi routers know that)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .