I have a mobile application that runs on android and I would like to map the API requests to an internal server on the network when the device is connected to a wifi network

The idea being that when we test the app we just have to log on to a specific wifi network and debug any issues instead of having to use different apps.

The basic idea is that when a device is on the wifi network and tries to connect to api.example.com, a local server picks it up instead of public facing api.example.com, but when the device is out in the wild it will connect as normal to api.example.com


You can use setup customized DNS servers (Unbound or Dnsmasq) to return different IP address of api.example.com, and setup DHCP servers to the customized ones.

In Unbound, it's local-data, e.g.:

local-data: "api.example.com A"

In Dnsmasq, it's --address=, e.g.:

  • i flashed my router with dd-wrt and used dnsmasq – Chris Mccabe Oct 25 '16 at 15:42

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.