I want to debug mobile version of my website on my iphone/android. But cannot open it on mobile. I've read some related questions and all they suggest is to add localname to /etc/hosts but I already have it, but still cannot access it from mobile.

Yes - I'm on the same WiFi.

Yes - I can access web server by IP, but not localname.

What did I miss?


If you can get to your web server via IP address but not by hostname that means that you do not have DNS configured. DNS is designed to translate between so-called "friendly names" and IP addresses via a DNS server.

You can't edit the /etc/hosts file on iOS without jailbreaking your iPhone.

What you need to do is be able to manually configure your router (assuming you have a common home router provided by your ISP) to point local addresses to specific local host names. Unfortunately most home routers don't let you modify DNS settings, instead they pass DNS through to the ISP's DNS servers or use a public DNS server.

So what you would need to do is set up a DNS server on your local network to point local IP addresses to specific host names and then set up your iPhone to use that DNS server in Settings > WiFi > [your Wifi network] > Configure DNS > Manual.

But honestly that is a lot of trouble, I'd just use the IP address.

  • the problem with IP address is that I have website on wordpress which redirects me immediately to site name. I wonder why so many articles on Internet explaining how to access another Mac from the same WiFi through local name but all of them (100% every article) are wrong – Vitalii Korsakov Oct 28 '18 at 15:57
  • There should be a way to change the redirect in WP to something else. I imagine a perusal of the WP forums might turn up a solution to that particular issue. – Steve Chambers Oct 28 '18 at 16:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .