More recent android phones can natively support a hotspot, mostly for tethering. However, what sucks, people who created it never thought about such a simple thing as supporting a full-blown dns for lan. This howto describes how to enable that.
Why the hell would I want that?
Mostly, if I have 2 or more people on the network and want to use ssh/http/webdav locally, I need to find out the ip adresses. And that is pretty crappy, since they are pretty random. I just want PCs on that net have something like fred.lan or something similar.
Okay, so here’s how to fix it. This manual works for my chinese HD7 Pro mobile phone, but that should be pretty generic.
1. Root your phone, if you haven’t yet.
2. Make sure you have busybox around.
First, remount /system as rw, like
mount -o rw,remount /dev/block/mtdlock11 /system
mtdblock11 is device specific, find which is the system via mount command with no args.
Next, we need to find out the ip address of the hotspot. Just run ‘ifconfig’ on the device. You’ll see it there.
Alternatively you can use some gui crap on the market. Tools like wireless adb also print out your ip adress.
In my case the address was 192.168.43.1
Next, we need to edit a couple of files. I picked the domain name ‘portable’ and the hostname ‘anomalia’ for my phone.
So I added the following to the /system/etc/hosts
192.168.43.1 anomalia anomalia.portable
Next goes a really weird trick. The dnsmasq is started with a bunch of command line args, that I don’t know where to change (or better to say – didn’t take the effort to).
But we can put any extra options into the configuration file, that didn’t even exist on my device.
So just create a /system/etc/dnsmask.conf with the following
You are done. Restart the hostspot and you can now access the pcs on the network via their hostnames.
E.g. you can access your phone via wireless adb using: adb connect anomalia:8888 and don’t bother yourself with anything else.