TransWikia.com

Can I identify my PI by domain name in a LAN?

Raspberry Pi Asked by Dorin Botan on November 21, 2021

RPI can be accessed from computers in the same LAN by using it’s local ip.
If I want to access it by a specific name, I can set it up in hosts file. This works nice if RPI has a static ip, but not when it moves from one location to another?

UPnP is used by some programs to programmatically open the ports on the router. Isn’t there a similar approach to write the name in to the router?

3 Answers

Its not a direct ancer but For ip lookup i use fing android app https://play.google.com/store/apps/details?id=com.overlook.android.fing To find al my (rpi) divices

Answered by Thomas on November 21, 2021

Unless you disable it (i.e. by default), Raspbian is running a service called Avahi which responds to mDNS requests in your local network.

By default machines are configured to appear in .local domain, so a fresh Raspbian will be accessible with raspberrypi.local from other machines using Avahi. If you change the hostname, it will be reflected in Avahi response.

Machines also by default are configured to strip .local domain when accessing other ones, so it's usually enough just to access the destination machine by its hostname (like raspberrypi). Hostnames should be of course kept unique to avoid random connections to one or another.


The Avahi service is enabled by default in macOS (implementation known as Bonjour) and most desktop Linux distributions.

It was not available separately for Windows versions earlier than Windows 10, but came with Apple iTunes (and even if you uninstalled iTunes, chances are Bonjour would still remain installed).

With Windows 10, mDNS seems initially was supported natively, but with bugs, and now at least supported programmatically (some reference). This paragraph is subject to change and clarification.


Unless you have a multi-network configuration, Avahi is enough to get your machines discovered without using IP.

With multi-network configuration (i.e. if you use router between two separate IP networks like 192.168.1.0/24 and 192.168.2.0/24 you can set the router as Avahi reflector (provided it has Avahi running), or you can configure DNS as suggested in ppumkin's answer.

Answered by techraf on November 21, 2021

Yes. Its called DNS (Domain Name System)

Home / Small Office networks are usually set up using a router of some kind. This router is responsible for DHCP (assigning IP addresses) and DNS (assigning a domain name to that IP address)

So as long as your router is set up properly: In such that your DHCP sets your router as authoritative DNS with reverse lookup (like rDNS but just an internal router mechanism) setup, then you should be able to ping a default Raspbian install like ping rasperrypi within your Local Area Network.

In many cases, especially with home routers this does not work because reverse lookups are disabled, not implemented or just the router sucks. This is improving though as more IoT devices are running on our LAN's and more routers are using BSD based OS'es - This makes is easy to find them (Yay, 20 years later)

This is a very simple explanation for internal uses. On the internet DNS gets very complicated and only specific entities control how names get resolved.

A few things to check on your ipconfig

  • Do you have a DNS entry for your router? The same as gateway? Then outside (ISP/Google/OpenDNS)
  • Log into the router and click on DHCP. Look at any names assigned to the IP. If you cannot see them then maybe your router sucks ;(
  • Again, on your router check in DHCP settings for rDNS or something in that name and enable it. Some routers have it always enabled some do not even offer it. It get messy from vendor to vendor.
  • Make your own router using pfSense or openWRT - You wont regret it.

If your router does not support reverse lookups then techraf's answer explains about why mDNS services where created.

Answered by Piotr Kula on November 21, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP