Unable to access Raspberry Pi homepage by domain on iPhone

Well, it’s a normal behavior. Windows is adding the local domain name to your ping request if there is no other domain inside the address/request. Therefore, it is not working the way you tried.

Let me try to explain. Usually, the local domain record is assigned by your DHCP server to your DHCP client. You can check it on Windows using ipconfig. It will show the DNS-Suffix. In my case it is lan

C:\Users\>ipconfig

Windows-IP-Konfiguration

Drahtlos-LAN-Adapter WLAN:

   Verbindungsspezifisches DNS-Suffix: lan
   IPv4-Adresse  . . . . . . . . . . : 192.168.0.92
   Subnetzmaske  . . . . . . . . . . : 255.255.255.0
   Standardgateway . . . . . . . . . : 192.168.0.1

C:\Users\>

For testing I installed a fresh PiHole and tcpdump tool to be able to trace network traffic. Inside PiHole I created a new local DNS record for host raspberry.

Trying to ping the host raspberry will result in same error as your test.

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

C:\Users\>

In parallel I was doing some network trace on the test system hosting PiHole

21:45:53.149163 eth0  In  IP 192.168.0.92.65510 > 192.168.0.17.53: 63579+ A? raspberry.lan. (31)
21:45:53.150055 eth0  Out IP 192.168.0.17.46212 > 8.8.4.4.53: 12455+ A? raspberry.lan. (31)
21:45:53.166577 eth0  In  IP 8.8.4.4.53 > 192.168.0.17.46212: 12455 NXDomain 0/1/0 (106)
21:45:53.166852 eth0  Out IP 192.168.0.17.53 > 192.168.0.92.65510: 63579 NXDomain 0/1/0 (106)
21:46:03.041118 eth0  In  IP 192.168.0.92.65510 > 192.168.0.17.53: 5697+ A? NPIA60B4F.lan. (31)
21:46:03.041493 eth0  Out IP 192.168.0.17.53 > 192.168.0.92.65510: 5697 NXDomain 0/0/0 (31)

You see, my Windows box (192.168.0.92) is asking test PiHole system (192.168.0.17). But the Windows box is not asking for host raspberry but for raspberry.lan. :wink:

Windows has added DNS-Suffix: lan to the host name request. As this one is unknown to PiHole, query is forward to upstream Google DNS server 8.8.4.4. At the end it is resulting in an unknown domain NXDomain. That’s why you get the unknown host message in your ping test.

To work around, you need to add local DNS record raspberry.lan instead of raspberry

This way, ping is working fine on Windows

C:\Users\>ping raspberry

Ping wird ausgeführt für raspberry.lan [192.168.0.11] mit 32 Bytes Daten:
Antwort von 192.168.0.11: Bytes=32 Zeit=4ms TTL=64
Antwort von 192.168.0.11: Bytes=32 Zeit=4ms TTL=64

Ping-Statistik für 192.168.0.11:
    Pakete: Gesendet = 2, Empfangen = 2, Verloren = 0
    (0% Verlust),
Ca. Zeitangaben in Millisek.:
    Minimum = 4ms, Maximum = 4ms, Mittelwert = 4ms

tcpdump is showing correct trace as well

22:09:08.954224 eth0  In  IP 192.168.0.92.65208 > 192.168.0.17.53: 61137+ A? raspberry.lan. (31)
22:09:08.955081 eth0  Out IP 192.168.0.17.53 > 192.168.0.92.65208: 61137* 1/0/0 A 192.168.0.11 (47)

And finally, I’m able to reach a web site using http://raspberry:8080/

Hope this make your situation a little bit more clear :slight_smile: