Scan local network to get the IP address

After many searches on the web, reading a lot and searches a bit more it starts to look that something that looks simple, seems difficult to do.
Because, as far as I understand, does Android NOT support MDNS (like: mylamp.local) there must be a 'simple' or at least, another way to get the IP address.

If I type in a browser (pc) http://mylamp.local/current_ip, I get the current IP of that device.
So, I am just wondering if it is possible to make a sort of function/part of an app that could find the IP addresses of my own web servers (mylamp)?
I guess it has to search my local network and try to find the host name of a device but then ...

Any idea where to go?
Maybe it because this is not my native language and the words I use are a wrong translation! So forgive me if I ask something stupid/wrong.
Thanks,
Ray.

1 Like

Perhaps this terminal extension:

and the ping command...e.g.

ping -c 1 yourlocalserver.com

1 Like

Thanks for the response. That is something to look it to be unfortunate is me Spanish even worst then my English!

It Normally the IP of a web server is static and known. Set up your web server with a static IP.

Check with an interval of 30 seconds, with the Web component from 192.168.1.2 to 192.168.1.12, for example, and see ScreenErrorOcurred and responseCode

1 Like

I didn't like to say, as Juan suggests that seems the most obvious thing, I know the IP addresses of all my local servers (don't actually use "names") but I can see there are situations where local DNS resolution may be required

Scan IP.
Clock.Interval: 500

Uhm. That's sounds like moving the problem to another problem. But normal isn't normal these days I guess. So I really think that it's not normal to change the web-server IP. to a fixed IP. in this situation.

That is up to you. Most admins use fixed IPs for their servers.

Of course, fixed IP is the easy solution here. However, it ignores the fact that mDNS exists as a facility for being able to have local IoT devices by name rather than hard-coded IP addresses. As the number of IoT devices increases or devices get added/removed, having a dynamic way of managing the IP addresses becomes more necessary to avoid lots of manual configuration and more room for error. mDNS lets you more easily dynamically add devices and then look them up by service they provide and/or by name and to get their IPs programmatically.

There are Android applications (e.g., Bonjour Browser) that can identify mDNS names and their associated DHCP-assigned IP addresses.

The question then remains: why not provide this lookup facility in an AppInventor component?