Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My Android device is the Nexus One. But this should apply to all current Android devices.

How do I change the name of my Android device?

When I connect to my wireless router's client tables, my android devices is listed for example as: android_1234567890abedfc. I'd like to give it a more readable name.

share|improve this question
It's also possible to configure the hostname via the DHCP server. But I haven't checked if android uses this configuration option. It's anyways just a cosmetic option. – Flow Nov 30 '11 at 16:34
@Flow (Varies but) Android DHCPCD does not have the dhcpcd-run-hooks for setting the hostname from DHCP. Atleast on my Samsung Froyo device. It doesn't have the ntp hooks either. DHCPCD does support it though. – cde Jan 4 '14 at 14:31
for GNU Linux: , low level kernel methods will work – Ciro Santilli 巴拿馬文件 六四事件 法轮功 Nov 30 '15 at 21:09

To change the hostname (device name) you have to use the terminal (as root):

For Eclair (2.1): echo MYNAME > /proc/sys/kernel/hostname

For Froyo (2.2): (works also on most 2.3) setprop net.hostname MYNAME

Then restart your wi-fi. To see the change, type uname -a

some devices needs reboot for work!

share|improve this answer
Does this work on jelly bean? – James Sep 1 '12 at 3:43
This works, but does not persist on reboot. – palswim Aug 8 '13 at 18:16
uname -a doesn't show the hostname for me, though it does say localhost. what do you expect it to show? – endolith Feb 28 at 0:11

I found a way to do this on my rooted Nexus 7 with 4.2.2. The setting is saved persistently and works throughout reboots.

  1. Note that the device must be rooted to use adb
  2. Run adb pull /system/build.prop
  3. Edit the build.prop file and append net.hostname=NewHostname
  4. Run adb push build.prop /sdcard/build.prop (or /mnt/sdcard, if it fails)
  5. Run adb shell and execute the following commands:
    $ su
    # mount -o remount,rw /system
    # cp /sdcard/build.prop /system/build.prop (or /mnt/sdcard if you used that previously)
    # mount -o remount,ro /system
    # exit
  6. Reboot the device
share|improve this answer
This was fixed in newer versions of Android. It checks net.hostname from build.prop. Older Android versions do not (Mainly Froyo, maybe Gingerbread). – cde Jan 4 '14 at 12:22
ICS isnt 4.2.2, that would be JB – HasH_BrowN Sep 27 '14 at 20:17
an easier way to do this is to use the setprop command via a root shell on the device: for example setprop net.hostname NewHostName – Mark Oct 16 '14 at 0:00

This works on CyanogenMod and probably other modified ROMs but not stock AOSP ROMs:

Go to Settings > Developer Options and scroll down to Device Hostname. Root is not needed.

(Click image to enlarge)


share|improve this answer
Yeah, you can't do this on an Acer A100 tablet running Android 4.0.3. In fact, it doesn't even have "Device hostname" in the Developer Options. – bgmCoder Nov 4 '15 at 4:14

I have not ran stock in a long time but in Application Settings > Development you will see the option 'Device hostname'.

share|improve this answer
on what versions of Android? When I look at development options on my Droid 3 (Android 2.3.4), I don't have that option. – Michael Kohne Mar 19 '12 at 15:24
This works on CyanogenMOD and probably other modified ROMs but not stock AOSP ROMs. – Caleb Oct 18 '13 at 15:50
Completely dependent on the manufacturer and builder, as well as android version. – cde Jan 4 '14 at 12:21

Depends on which version of Android you have. Newer versions will use the right build.prop entry. Well, that is to say, Android reads the build.prop as it's normal boot process. Once the Connectivity Service runs, it checks to see if net.hostname is set in the Settings, then if empty, then it uses the "android_" + (permanent) android ID. So that's all you need to do. Add net.hostname=HOSTNAMEHERE to /system/build.prop. Leave a blank line at the end of the file.

Older versions, Gingerbread, Froyo, etc, just clobber it. It doesn't bother to check. It will set net.hostname to android_24412414... no matter what. So you will need to change it after that Connectivity Service has finished loading. Luckily, it only runs the startup once, not on every new connection. So we just need to run setprop net.hostname HOSTNAMEHERE after that for it to stick. Unfortunately, it runs fairly late in the boot process, so you need something that will make the changes on boot_complete. Most likely an App that runs by itself.

But then there is another issue. The net.hostname setting, is not copied to the entire system! If you use a console/terminal application, you might not get the same hostname. My phone, a Samsung Sidekick 4G (semi-Galaxy S based) has an init.rc which runs hostname localhost, so all underneath commands will not see either your build.prop hostname or the android_id hostname! So you need to set that too.

hostname HOSTNAMEHERE or echo HOSTNAMEHERE > /proc/sys/kernel/hostname

Note: Depending on how you are doing it, you'll need to run the above command as root in order for it to work. Init.rc is typically on the read only system partition, so root access is needed to edit it.

The dhcpcd command, which is run to get a dhcp address, will not update to a hostname provided by the server (That can be fixed by adding the right dhcpcd-run-hooks and dhcpcd.conf), and it will not provide a hostname to the dhcp server if $(hostname) is blank or localhost, and it does not internally use net.hostname. libnetutils is used for calling dhcpcd with -h "net.hostname", but if for some reason it decides not to call with -h, DHCPCD WILL STILL SEND THE SYSTEM HOSTNAME via gethostname(), as long as it's not "(none)","localhost", or empty. On Stock Froyo anyway. Samsung screwed the pooch on some devices like mine. No hostname pass through, forced network time, etc.

The last thing you can do is edit /etc/dhcpcd/dhcpcd.conf. If you add hostname YOURHOSTNAME to the file, it will use that, unless a hostname is given on the commandline. This won't fix the android_234etc issue, but will if the hostname is localhost (My problem, since Samsung screwed libnetutils and localhost in init.rc). You will need Root, but this works across reboots.

share|improve this answer

Go to Google Play Store. Search for "hostname", and download hostname changer app.

Must be rooted.

share|improve this answer
This worked fine for me thanks. – Pierre de LESPINAY Jul 3 '13 at 10:42
Will renaming the device mess up anything internally? – bgmCoder Nov 4 '15 at 4:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.