I've started MAMP on my computer and I'd like to make a GET call from Android app. I'd like to access the computer by it's name(e.g. computer.local:8888) rather than the computer's ip.

On the computer if I open Chrome and type computer.local:8888 it works as expected. On the phone this fails, but typing it's local ip ( works.

So, is it possible to access a local http server by a name rather than ip ? If so, how ?

  • Programming questions should be asked in StackOverflow.com
    – geffchang
    Jul 8 '13 at 11:08
  • 1
    @geffchang I don't think this is really a programming question. It could just as easily be about accessing a local web server in the browser, or using a local network video stream in a video player.
    – Dan Hulme
    Jul 8 '13 at 11:42
  • @geffchang just rephrased, same thing, different way of accessing Jul 8 '13 at 11:54
  • Looks completely on-topic to me (same explanation as Dan above). Forget about the development-related section: that's not the issue George has, but only serves to give some background for better understanding. He would have the very same trouble with all other examples Dan described -- and no development would be involved.
    – Izzy
    Jul 8 '13 at 12:08

Go to Settings→Network, tap WiFi, and watch out for your WiFi AP here. Tap it, select to edit it. Toggle the "advanced settings" to be shown.

By default, WiFi is configured via DHCP -- but for some reason unknown to me (and escaping my understanding), Android doesn't pick the name servers via DHCP, and instead sticks to Google's hardcoded ones (e.g. So in this place, you need to switch to a static IP, set the default gateway correspondingly, and put your own name server's address (most likely again your router's IP) into the field for DNS1.

Save the changes, and you should be able to use your local hostnames. You could even try switching back to DHCP, and see whether it keeps your DNS1 settings.

To calm down upcoming worries: This only affects the WiFi AP you edited, no system-wide changes for all WiFi APs. In the worst case, you always can delete the AP and re-create it.

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.