Making android hotspot mode usable.

Written by

in

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

local=/portable/
domain=portable 

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.

Comments

2 responses to “Making android hotspot mode usable.”

  1. […] Okay, getting to business now. Doing stuff below will most likely void the warranty, so be warned. With the right skills this will work on any android phone on the market. Just a note – I got my phone rooted and had busybox installed ages ago, so I won’t describe this procedure. This is required for further stuff to work. The first thing I’ve done – hacked the dnsmasq config file, so that it will do local dns… […]

  2. […] few posts ago, I wrote about making android’s dnsmasq more usable by turning on local hostname resolution. Since I use my android phone as a pocket server, dnsmasq plays a vital role here. However, one […]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.