Monday, January 21, 2019

networking - Zeroconf mDNS on Android?



Is it possible for me to run a Zeroconf mDNS server on my Android phone? Something like Avahi on Linux.


The reason I ask is because I run an SSH/SFTP server on my phone for transferring files to/from the phone. Right now I have to connect using the local IP address (10.1.0.x) and the IP changes via DHCP. I'd like to simply be able to connect to my phone using a .local address.


I don't think Dynamic DNS will work, because I want my LAN address (the private IP, 10.1.0.x) not my public NAT IP.



Answer



Do you have any control over the (presumably wireless) LAN that you're connecting your phone to? It seems to me that the main part of your problem is just that your phone picks up different IP addresses each time it connects to your LAN. If it always had the same IP, then you could either make a note of this, save it in your SSH client, or assign a name to that IP on your other machine(s) using a HOSTS file or similar.


Are you in control of your network, or do you know the person that is? You (or they) should be able to assign a static IP address, or a reserved IP address, to your device so that every time you connect your phone to the LAN it always picks up the same IP address.


If it's a small, personal network then this would just be a setting on your device's record on your router, if this is a larger network then it would be setup on the DHCP server and a matching A name record could also be setup on their internal DNS to give you a permanent name.


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...