ish-app / ish

Linux shell for iOS
https://ish.app
Other
17.1k stars 906 forks source link

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

Open tjdodson opened 1 year ago

tjdodson commented 1 year ago

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:

Raspberry Pi Information:

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:

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.

freebrowser1 commented 1 year ago

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 pi@raspberrypi.local
ssh: Could not resolve hostname raspberrypi.local: Name does not resolve

But you can try.

saagarjha commented 1 year ago

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

tjdodson commented 1 year ago

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 pi@raspberrypi.local
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.

k3v1nwrld commented 10 months ago

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

AutomationD commented 8 months ago

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?)