ish-app / ish

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

Incompatible with DNS from Huawei Router model HG658d #1113

Closed corn-snake closed 3 years ago

corn-snake commented 3 years ago

the IO same errors happen when using apk upgrade or apk update

might also be an error with the cdn, but I just checked & nothing out of the ordinary

gitdev-bash commented 3 years ago

Well from what I see here it could be that iSH does not have a internet connection or that the cdn Webserver of alpine linux is blocked in your environment. The reason can be that you have to use a proxy (that iSH does not use) , your internet connection is down or that your isp or your local network administrator blocked the cdn server. Check by pinging the server: ping dl-cdn.alpinelinux.org If the server answers it’s a local Problem with your Installation. :-)

corn-snake commented 3 years ago

ping: bad address 'dl-cdn.alpinelinux.org' i've no idea at this point.

checked router settings, nothing outta the usual. same with device settings; no proxy config, internet connection's good.

i doubt that my isp blocked the domain 'cause it worked last time i checked (two/three weeks ago)

i suppose it has to do with the installation or something; accessing the domain normally (as in through a browser) yields no odd results

tbodt commented 3 years ago

This could be a DNS configuration bug. Can you ping IP addresses? If so, what's the contents of /etc/resolv.conf? Try pointing it to some other nameserver such as 1.1.1.1.

corn-snake commented 3 years ago

image pinging goes well

image gonna try doing the 1.1.1.1

image well isn't that fun.... why tho..? anyway, i guess that's solved.

thanks!

corn-snake commented 3 years ago

wait no

i closed the app, then opened it again cause i forgot something, but the issue returned image

apparently the file can't quite be permanently updated. cat'ing the file shows the old ip.s. ;-; # version's 1.0.4 from TestFlight if that's important

gitdev-bash commented 3 years ago

Try running this as root :echo "1.1.1.1" > /etc/hostname && hostname -F /etc/hostname And then restart ISH (end and restart) Should fix it :-)

corn-snake commented 3 years ago

image not quite working :/

maybe it's just me not knowing how to run as root (i cd'd into "/root")

saagarjha commented 3 years ago

I suspect this is because we unconditionally write nameservers on app startup? @tbodt, ideas on what we should be doing in this situation?

corn-snake commented 3 years ago

also, using .bashrc to do the job can't do the job exactly. image

though echo'ing the lines into the file normally does seem to work image

gitdev-bash commented 3 years ago

You know that to run as root you have to Type su - :( It’s one of the first things you learn

saagarjha commented 3 years ago

You're already root by default when you start iSH.

gitdev-bash commented 3 years ago

And I found this online:

You can solve the problem by installing the dhclient package. For the last time enable Google's DNS servers by runing for the last time:

sudo su "echo 'nameserver 8.8.8.8' > /etc/resolv.conf"

Then run this cocktail of commands:

sudo apk update && sudo apk upgrade && sudo apk add dhclient

In order to get the fresh packages and install the dhclient. Then configure the /etc/dhcp/dhclient.conf and put the following:

option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;

send host-name = gethostname(); request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, domain-search, host-name, dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers, netbios-name-servers, netbios-scope, interface-mtu, rfc3442-classless-static-routes, ntp-servers;

prepend domain-name-servers 8.8.8.8, 8.8.4.4;

And restart the networking: sudo rc-service networking restart

Optionally you can confirm that works if you run:

sudo reboot

In either case you can confirm that dns is resolved by pinging the google.

ping google.com

Sorry for the non working command! I sent you before

gitdev-bash commented 3 years ago

New title: DNS resolv.conf config broken

tbodt commented 3 years ago

@cypr3ss What ISP are you using? What type of connection (wireless, cellular, etc)?

corn-snake commented 3 years ago

Provider' name's Telmex (I live in Mexico). Wireless connection, Huawei Router model HG658d

tbodt commented 3 years ago

My guess is this is an incompatibility between musl and your router. Unfortunately /etc/resolv.conf gets overwritten every time you start the app, so changing it is really only a temporary solution.

corn-snake commented 3 years ago

huzzah! I managed to find the problem.

image why ye little-!

image that should do it...

image yup, that went better than expected! # fun. anyway, i do think there's some funky business going on with the whole write-ins at startup, so that's a suggestion: don't force nameserver writes at startup, maybe a small config of those at first use

tbodt commented 3 years ago

It's necessary to overwrite /etc/resolv.conf, or DNS won't work at all. Not sure why I didn't think of changing system DNS settings here.

Someone on reddit had the idea of writing a DNS proxy to run on localhost; this could fix any situations where DNS works with iOS and not musl, including mDNS. That would be a separate issue though.

corn-snake commented 3 years ago

i think i know why the problem arose: 192.168.1.254 is the local pingback address to the router, which is then supposed to forward to an external dns ip (in this case: 189.233.13.5). The thing kinda crosswired somewhere between the request to the router & the request to the dns servo (or my 3rd world internet provider's dns is just very useless).