I've a website running on my computer, and I want to test it from my Nexus 7 tablet. I.e. over the local WiFi LAN. If I type in the IP address it connects, but shows the wrong web site, because I'm using named virtual hosting.
So, what I want to do is be able to type mysite.local
in to Chrome/Firefox on the Nexus, have them convert that to 10.1.2.3
(or whatever the local IP address is), then call the 10.1.2.3
server giving mysite.local
as the Host to request.
My Question: Does an Android 4.x tablet have an /etc/hosts
files, or equivalent, that I can edit? (Without having to root the tablet, or anything like that.)
On my Linux computers I do this by adding an entry in /etc/hosts
:
10.1.2.3 mysite.local
(Or Windows\System32\drivers\etc\hosts
on a Windows machine does the same.)
BTW, this is a semi-duplicate of Manually set a hostname for IP address (i.e. /etc/hosts equiv.?), but that question was for Android 2.2, where apparently it was not possible. (One of the alternative ideas suggested there was configure DNS at the local router, but as far as I can tell my router does not do DNS locally so does not have that option. I could set up my own DNS server to do this, but that feels like a Big Job Solution.)
/etc/hosts
, but configuring your "name server" (e.g. DNSMasq, or whatever you use). Your router might give you a place for that./etc/hosts
needs to be edited on each machine otherwise – and the corresponding file on Android can only be edited with "root powers" (I don't know its exact location out-of-my-head, but it's somewhere inside/data/system
AFAIR). See: How to edit etc/hosts file