I can´t visit my raspberry pi webserver trought domain name on smartphone

  dns, python, raspberry-pi

Hello stackoverflow community,

I have my LAMP server fully functional running on my raspberry pi4.

Im working on a project to controll a car from an app (made in python using kivy library). Im working with the DB inside the pi.
My problem here is that in the app i use the following line:

mydb = mysql.connector.connect(host="skye", user="client", passwd="afonso",database="skye_pap") 

Skye is my raspberry name and i can access it from my pc.
But when i run my app in the smartphone i cant use the raspberry name, i can only use his ip:

mydb = mysql.connector.connect(host="192.168.1.115", user="client", passwd="afonso",database="skye_pap") 

In smartphone, the app works only when i use the host as 192.168.1.115

When i want to visit the LAMP local website i open my browser in the computer and type http://[my pi’s name] and i can access it, but when im in my smartphone i cant access it by typing http://[my pi’s name], i can only access it trought the ip…

When i search http://skye in my smartphone it gives me this error:
DNS_PROBE_FINISHED_NXDOMAIN

Im wondering why is this happenning, i’ve already tried with other smartphones and other computers and the result is the same. On the computer i can access the website from both ways, but in the smartphone i can only access it by its ip.

Source: Python Questions

LEAVE A COMMENT