Search code examples
androidremote-accessandroid-filehostsvirtual-hosts

Virtual Hosting on my android device not working


I am trying Virtual Hosting on my Android Device. For this I edited hosts file on following path: /system/etc/hosts as:

127.0.0.1           localhost
192.168.69.65           myserver.test.com

But this change is not working for me. Still when I am browsing myserver.test.com from browser, it is showing some random results and not hitting the actual server(i.e. 192.168.69.65). On the other hand if I browse 192.168.69.65 directly it is working fine. Please suggest something.

Regardss, Rahul


Solution

  • I found the solution. I need to put 1 empty line at end of file to make system to reload file like:

    1.    127.0.0.1           localhost
    2.    192.168.69.65           myserver.test.com
    3. 
    

    No need to restart phone at all, i can ping new hostname immediatelly. Thanks... :)