Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mapping a hostname to an IP address on Android

I know that I have to edit the /system/etc/hosts to map an IP address to a host name, but it seems that I can't edit the file. Is it because my android phone is not rooted?

Kindly advise. Thanks.

like image 432
user800666 Avatar asked Jun 16 '11 09:06

user800666


1 Answers

You can use the following guide and application to setup rules for specific domains.

  • Download (Daedalus) and open the application.
  • Click on the menu then click “Servers”

menu

  • Click the add button and add the two google servers “8.8.8.8” and “8.8.4.4”, You can substitute these for your preferred DNS provider as well.

dns settings

  • Activate these dns servers in the menu by clicking on “Settings”
  • Then select Google and Google 2 from the settings. Also activate Advance settings and select the two following options in the image below

settings

  • Back to the menu now, Click on “Rules”.
  • Add a new rule for each development mode, Live, staging, dev. Filename is not crucial, just make something up.
  • Hit sync rule before leaving to make sure the file is downloaded.

    rules

  • Tap and activate the mode you wish to be in, You can activate more than one at a time so be careful as this will override one or the other.

  • In the menu go to home, and hit the “Activate” button.

activate

Source: https://silocitylabs.com/post/2018/03/02/changing-dns-settings-for-android-development/

like image 75
ldrrp Avatar answered Sep 20 '22 09:09

ldrrp