2

I have a requirement of "map a hostname to an IP address on Android" programmatically. This may require an entry in /system/etc/hosts file. I can see few open-source code that edit the /system/etc/hosts file but require Root Access.

Can I achieve same functionality without Root Access? or please suggest any alternate solution to resolve local host/domain.

Thanks

  • Editing of /system/etc/hosts file is not permissible without root access. However, in order to map a hostname to an IP, you can setup your own DNS server on your network and configure the device to use that network. – nandal Jun 01 '18 at 09:19
  • @nandal thank you very much for your response. Can you please elaborate your answer more? I mean to setup own DNS server and configure device with it. – Muhammad Rashid Mahmood Jun 02 '18 at 18:28

0 Answers0