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.

Gihan
  • 111
  • 3
  • 2
    Yes you can, although typically developers simply add an entry for api.exaple.com to their [hosts file](http://en.wikipedia.org/wiki/Hosts_%28file%29) – HBruijn May 14 '15 at 05:53
  • @HBruijn I suppose that may not be an option with mobile devices, though. – Håkan Lindqvist May 14 '15 at 07: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 '15 at 07:29

1 Answers1

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.

dmourati
  • 24,720
  • 2
  • 40
  • 69