Alchemist.Digital

// Jeffrey Reeves

Set Hostname on Android M (6.0.1)

November 5, 2016

Issue

Recently I configured my router to use DD-WRT, and I noticed that all of my Android devices would have a hostname in this format of ‘android-a3566e1d5961325d’.

DD-WRT

To make it easier to identify each device connected to my router, I decided to update the hostname on my OnePlus 3 — which is currently using Android M (6.0.1).

Steps

  1. Root your device if you haven’t already done it.
  2. Download the Terminal Emulator app from the Play Store.
    Download Terminal Emulator
  3. Open the Terminal Emulator and run the following commands:
    1. $ su
    2. (Grant access to root)
      Grant Root
    3. # setprop net.hostname <new_hostname>
    4. # getprop net.hostname
    5. (Check that it is the one you wanted)
      screenshot_20161105-131546
  4. Turn off wifi and then turn it back on.

If all went well your router should now show the new hostname you set.