I have a raspberry pi ( set up as an AP for a few devices. The WIFI connection works, DHCP also seems to give out valid addresses. The issue is that none of the devices in the network are able to resolve the hostname of the pi, 'home'. Here are some configuration files:

/etc/hosts       localhost
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters       home


interface wlan0
        static ip_address=
        static domain_name_servers=
        nohook wpa_supplicant
# WLAN-Router-Betrieb

# Schnittstelle und Treiber

# WLAN-Konfiguration

# WLAN-Verschlüsselung

1609402473 3c:71:bf:3a:09:c2 living-shelf *
1609402474 dc:4f:22:aa:08:1e living-computer-light *
1609402473 dc:4f:22:92:75:da living-beamer *
1609402647 c8:2b:96:53:79:a5 living-heater-carpet *
1609400799 dc:4f:22:a7:e5:4d living-light *
1609402473 84:0d:8e:aa:81:7c kitchen-passage *
1609402514 3c:71:bf:3a:12:8f living-wallclock *
1609402652 c8:2b:96:53:77:bd tasmota-printer *

My questions are:

  1. Which component of my AP-pi should recognize a DNS query as a hostname of one of the devices and resolve it?
  2. What do I have to set up in order for all the devices in the network to be able to reach each other through their hostnames?
  3. What is required for the devices to be able to reach the AP-pi by its hostname?
  • What are the other devices? What are you trying to reach the Pi with (ping, shh, ftp etc)? What commands have you issued? Technically this is not a Pi issue as it's the other devices having the issue :-)
    – user115418
    Commented Dec 30, 2020 at 23:38
  • Most of the other devices are esp8266, but other PI's can't reach the main PI aswell. Also, I fear that the issue lies in the DNS somewhere in the AP-pi.
    – Daniel D.
    Commented Dec 31, 2020 at 3:06
  • You need to have a look at the host file and add a proper entry for the Pi using the <Pi FQDN> - I use .local here being basically a Mac network but others here may shout at me for that :-) so my entry would be home.local then sudo systemctl restart dnsmasq
    – user115418
    Commented Dec 31, 2020 at 13:28
  • What did you try that didn't work?
    – Milliways
    Commented Jan 1, 2021 at 0:36

1 Answer 1


You are asking for a general tutorial in name resolution which has nothing to do with Raspberry Pi. It is a general networking issue and I can only give an overview where you can look for more details.

At the beginning of the internet there was a simple file /etc/hosts used that contained all ip address to name mappings on every device. It is obviously that this can't be handled on a growing network.

The evolution comes to the Domain Name Service, in short DNS, that becomes a distributed database all over the world with ip address to name mappings, organized in a tree manner. Yeah, and that is not simple to manage and needs some deeper knowledge about networking.

This was the reason why there was defined a self configuring name resolution system for small local networks using multicast messages. This system is called mDNS (multicast DNS). Because of its nature it cannot pass router so it is restricted to the local network with the same ip address range, a so called broadcast domain.

To have a name resolution on your local network you must decide what system you want to use. Using /etc/hosts is very simple and always still works.

When you get tired to manage all names on all devices you can use one of the other solutions. To configure a DNS system you have to setup a DNS server with your own domain. Please never use domain local because it is reserved for mDNS. You also have to ensure that this private DNS-server queries other DNS-server on the internet for names that it is not authoritative (eg. google.com).

Too complicated? Then you should use mDNS. On a Linux operating system this is managed by the avahi program. On the default Raspberry Pi OS it is preinstalled and works out of the box. You should be able to address it with ping raspberrypi.local. All devices which support mDNS can be addressed with its hostname prepended to .local, for example ssh [email protected].

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.