ish icon indicating copy to clipboard operation
ish copied to clipboard

Unable to SSH into Raspberry Pi using Hostname.local in iSH App

Open tjdodson opened this issue 1 year ago • 5 comments

Issue Description: I attempted to establish an SSH connection to my Raspberry Pi using the hostname.local address in the iSH app. However, I encountered the following error: ssh: Could not resolve hostname raspberrypi.local: Name does not resolve. My intention behind setting up the iSH app was to create a portable, offline coding environment on my Pi, making it crucial to connect via the hostname.local address.

Interestingly, when using the Blink app on my iPad, I can successfully connect using the same hostname.local address and the user authentication credentials configured during the Pi OS setup.

System Information:

  • Device: iPad Pro (12.9-inch) (4th generation)
  • Operating System: iOS 17.1
  • iSH Version: 1.3.2 (Build 494)

Raspberry Pi Information:

  • Hostname: raspberrypi.local
  • OS: Debian GNU/Linux 11 (bullseye) aarch64
  • Hardware: Raspberry Pi 4 Model B Rev 1.1
  • Kernel: 5.15.32-v8+
  • Shell: bash 5.1.4

Steps to Reproduce:

  1. Attempt SSH connection using ssh raspberrypi.local.
  2. Encounter error: ssh: Could not resolve hostname raspberrypi.local: Name does not resolve.

Expected Behavior: I should be able to establish an SSH connection to the Raspberry Pi using the hostname.local address within the iSH app, similar to the functionality observed in the Blink app.

Additional Information:

  • I have successfully connected via IP address, but the objective is to connect using the hostname.local address.
  • The same hostname.local address works flawlessly in the Blink app, indicating that the Pi's configuration might not be the issue.

Screenshots: image Note: This issue significantly impacts my ability to use iSH as an offline coding environment on my Raspberry Pi. Any assistance or guidance to resolve this problem would be highly appreciated.

tjdodson avatar Oct 05 '23 03:10 tjdodson

Login as root on the Pi. First the avahi daemon should be installed on the Pi. Then configure : nano /etc/avahi/avahi-daemon.conf

...
[server]
# this name should match the hostname
host-name=raspberrypi  
#domain-name=local
#browse-domains=0pointer.de, zeroconf.org
use-ipv4=yes
...

Then run service avahi-daemon restart

Now login from any client (including iSH) to the Pi. For me it does not work neither.

iPad-Air-2:~# ssh [email protected]
ssh: Could not resolve hostname raspberrypi.local: Name does not resolve

But you can try.

freebrowser1 avatar Oct 05 '23 08:10 freebrowser1

iSH uses Musl by default, which has a fairly anemic DNS resolver. Perhaps installing nss would help?

saagarjha avatar Oct 05 '23 09:10 saagarjha

Login as root on the Pi. First the avahi daemon should be installed on the Pi. Then configure : nano /etc/avahi/avahi-daemon.conf

...
[server]
# this name should match the hostname
host-name=raspberrypi  
#domain-name=local
#browse-domains=0pointer.de, zeroconf.org
use-ipv4=yes
...

Then run service avahi-daemon restart

Now login from any client (including iSH) to the Pi. For me it does not work neither.

iPad-Air-2:~# ssh [email protected]
ssh: Could not resolve hostname raspberrypi.local: Name does not resolve

But you can try.

I'll try to do this tonight and report back.

tjdodson avatar Oct 09 '23 20:10 tjdodson

Any updates on this?? I think the problem is with iSH itself...

k3v1nwrld avatar Dec 29 '23 13:12 k3v1nwrld

When you're saying "offline environment", how does the setup look like? Do you connect to RPI directly from your iPad?

If so, why not ignore DNS configs alltogether and connect via IP address?

If not, why not configure your router and local DNS server to respond to dns requests properly? (Maybe also add static MAC reservation?)

AutomationD avatar Feb 19 '24 09:02 AutomationD