2

In my LAN I have:

  • 2 Windows PCs (Peach and Cocotero)
  • My RPi3 with Rasbian

In any of my Windows PCs, PING works perfectly against any of the host.

But when I perform a PING inside my RPi3 it, it seems it doesn't resolve the names. It says:

ping: Cocotero: Name or service not known

ping: Peach: Name or service not known

However, PING works when I use the local IPs of my PCs.

EDIT: I found out that there is a StackExchange community for the Raspberry Pi. Someone, please move. Thanks!

SuperJMN
  • 163

2 Answers2

2

You should check the DNS settings at your Raspbian.

Do a cat /etc/resolv.conf?to check what your current DNS settings are.

I assume your router is set as DNS for you Windows PCs. Set the DNS server in /etc/resolv.conf to the IP address of your router. That file should look like this:

nameserver 192.168.0.1

You have to change the IP address to your router's address.

chloesoe
  • 716
2

Windows is doing this via NetBIOS and broadcasting/discovering names on your local network. In linux, the nbbd daemon does something similar, when used with Samba/CIFS and smbd

However, ping and the other network diagnostic tools don't reference NetBIOS names in Linux, they do the standard DNS check (well, /etc/hosts then DNS....)

Easiest way to "solve" this is to set up a DNS server on your Pi and use a fake TLD to create a fake domain name and simply create DNS entries. Go a step further and set up dhcpd on the Pi to give out IPs based on Mac addresses.

I do this - when I want to broadcast a file to my TV, I can point to livingroomtv.my.home and when I want to upload files to my iPhone (using OPlayer) I can point my browser to iphone.my.home

ivanivan
  • 3,042