Chotaire Wiki

Stuff you didn't know

User Tools

Site Tools


android-hostname

Change Android hostname permanently

I have read many terrible articles about how to change the hostname of an Android device (the one that is shown on your Wifi access point and usually consists of “android-” followed by a hash of the mac address). What all these articles have in common is that they only work on a few devices (if at all) and some of them require you to make intrusive changes to your operating system.

Long story short, here is the proper way to change an Android hostname on all recent Android devices. The change will be persistent after reboot and will not require you to install busybox or init.d mods and the like.

Root your device

You will need to make changes to the system partition. Therefore the partition will have to be re-mounted read/write. You could use adb tools with USB debugging to remount your partition and echo the changes into the appropiate file. This will not work on devices with safe boot etc. So either way, you will end up rooting your device (or atleast make changes required for rooting a device) so to make things short, let's make a rooted device a requirement (it's a requirement in all other articles too).

Install ES File Explorer

The easiest way to change your hostname is by using ES File Explorer. We will have to edit the build.prop file. Please note that many build.prop editor do not allow adding a new line so you're on the safe side with ES File Explorer. This software can remount the system partition and has a built-in editor to make changes and add to configuration files.

Enable Root Explorer in ES File Explorer

Open ES File Explorer, click on the upper left world symbol so that a menu opens on the left of the screen. Scroll down until you find “Root-Explorer”. Enable Root-Explorer (click on the ON button) and then click on the “Root-Explorer” text itself until a white dialog opens and then click on “Mount R/W”. Now check “RW” for /system and click on OK. Your system partition is now ready for modifications.

Edit build.prop

Back in the file explorer click on the “/” button on the top of your screen to navigate to the root directory. Now click on the “system” folder to navigate into this partition. You will find a build.prop file, click it and use the built-in ES editor to open this file. You will now see a text file with a lot of properties. Scroll down to the bottom, click the “…” symbol in the upper right corner and then on “Edit”. Now append the following line:

net.hostname=whateverhostnameyouwish

Now click the back button and you will be asked to save the file.

Disable Root Explorer

Click on the world symbol again, click on “Root-Explorer” in the menu, now check “R” for /system (so that the partition is no longer mounted read/write), and then turn off “Root-Explorer” in the same menu by clicking the “On” button. You can now close ES File Explorer. You're done.

Reboot your device

For this change to become effective (and to test if it works persistently after a reboot) simply reboot your device. If everything works, you may uninstall ES File Explorer afterwards. Now log into your AP and verify that you are now using your new hostname.



android-hostname.txt · Last modified: 2019/04/20 16:58 by chotaire