Edit: I tried
raspberrypi. same result for both.
I am not very experienced in networking. However, i know some fundamentals.
Now, I do have one Raspberry Pi and one laptop connected to same WiFi in my home.
The hostnames are raspberrypi and laptop1.
When I check 192.168.1.1 (modem interface) I can see that both devices are connected to wifi, and their hostnames are correctly identified there.
The ip numbers are:
Then I think that if I make a ping from my laptop, addressing raspberrypi, as follows
The DNS should resolve name raspberrypi to the ip (192.168.1.40) and it should work fine. However, that is not the case. I get unknown host raspberrypi warning.
On the other hand, I am able to ping raspberrypi by
This is also valid for ssh or nslookup, etc.
I don’t understand why my router cannot resolve those hostnames and let my pc know about it.
I think I might have some conceptual misunderstanding. So, I will be waiting for any help.
Most routers contain a built-in DHCP server and a built-in DNS server, but very few routers make those two processes talk to each other. So when you see that your router “knows” that host “raspberrypi” has address 192.168.1.40, you’re really just seeing what the DHCP server knows. Because the two built-in server processes don’t talk to each other, the DNS server has no idea who “raspberrypi” is or what its IPv4 address is, so it can’t answer that question when queried via the DNS protocol.
So you probably need to manually enter those name-to-address mappings in the DNS server administration UI in your router, or use some other name resolution system (such as IETF ZeroConf a.k.a. mDNS) so that devices on your network can look up each others’ IP addresses by name.