1

I have mobile application which calls to an API (api.example.com) setup in web. For easy debugging purpose I would like to route this api calls to a server setup in my LAN. I have Bind9 setup on a machine and ADSL router has configured to use this DNS server. Also I've setup Apache virtual host for api.example.com.

So I'm interesting to know is there a way I can route/resolve api.example.com to my local apache server (192.168.1.5) by entering some records.

3
  • 2
    Yes you can, although typically developers simply add an entry for api.exaple.com to their hosts file
    – HBruijn
    May 14, 2015 at 5:53
  • @HBruijn I suppose that may not be an option with mobile devices, though. May 14, 2015 at 7:21
  • BothAndroid and IOS do, although changing the hosts file is typically not allowed on actual devices but within the device emulator that comes with the sdk you can easily.
    – HBruijn
    May 14, 2015 at 7:29

1 Answer 1

1

Sure. Set up BIND and declare an authoritative zone for example.com with an A record pointing to 192.168.1.5.

You'll probably want to use wireless on your mobile device to have it use your LAN DNS server.

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