1

I have a website hosted on Raspberry pi that needs to be accessed only on the local network.

I have installed Samba and ZeroConf Avahi so that I can find the site by calling:

http://raspberrypi/ On windows & http://raspberrypi.local/ on mac

How ever on Android smartphone, I can't do the same. It is showing me DNS resolve issue. How can I access the website?

1

You should be able to use the IP address from your Android Phone. To find the IP of the Pi enter the following the cmd prompt or powershell:

nslookup raspberrypi

This will give you the IP address that you can use to connect from your Android phone.

1

After researching a lot on trying to detect Avahi or Samba hosts on Android, the best solution is to access via IP.

Use this script to echo Server Address on the page. And use it to access via phone.

<?php echo $_SERVER["SERVER_ADDR"] ?>

Alternatively you can also echo a QR code to scan it via phone.

<img src="https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=<?php urlencode($_SERVER["SERVER_ADDR"]) ?>" alt="scan QR" />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.