How to Change Wifi Host Name of Your Android Device

Most of the ROMs (except CM) whether it be stock or any, don’t have a setting to change the host name of your Android device. Read on to know how to change it.

When you have a common wifi network between your desktop and mobile, it rather makes sense to have a proper host name for your phone instead of accessing it every time by the IP address. This is typically useful if you want to control your phone from your control using AirDroid for example. Chat using Texts. While most routers have an option to set host name for a specific MAC ID, but on some networks you might not have control, for example your office network.

The process is very simple, but you need a rooted device. If you have not rooted it yet, check XDA forums. I can’t help you in that. Also, you would need the Android SDK (mainly adb and the device drivers for your phone).

  • Turn on USB Debugging in developer options.


  • Connect it to your computer
  • Open terminal
  • Run adb pull /system/build.prop
  • Now edit build.prop (saved in the directory you executed the command) and add the following line:

  • Run adb push build.prop /sdcard (or /mnt/sdcard, if it fails).
  • Run adb shell and type the following commands:

  • Run adb reboot.
  • Enjoy

31 thoughts on “How to Change Wifi Host Name of Your Android Device

Add yours

  1. Your Hollyness! I’ve been looking for this since a long! Thanks! Any clue to change it on a new Android 9 Phone (Moto G8 Plus) without having to unlock bootloader? I don’t want to lose warranty but having no name on the DCHP Lease it’s not cool. Cheers!

    1. A lot has changed in android since I wrote this article nearly 7 years ago… So I don’t know if this even works now.

      Some devices these days let you set the hostname sent to DHCP in About section..

      It might be just easier to bind the mac address to hostname in the DHCP server if have a DHCP server with editable configuration.

  2. Worked on XPERIA Z1 , CHINA TABLET A13 (rom MAXPAN 713) (used totalcommander with root privileges to copy/edit buildprop file without adb)

    1. Am trying to figure out whether I really need adb at all with a rooted device, busybox, superuser and a file editor and terminal emulator. I might need to hook up a usb keyboard but with that I should be good to go editing everything locally, right?

      Well, seeing your response above gives me hope that it is as I think it should be and I can edit things like the hosts file locally, on the Ouya.

    2. You need at least root if the ROM provided by OEM does not support it directly. Try enabling developer mode, it’s sometimes present there (at least it is there on CM based ROMs).

  3. Alternatively, you can use this once you’ve edited the build.prop file
    adb root (this restarts adbd as root)
    adb remount (this makes reading/writing from the /system area possible)
    adb push build.prop /system/build.prop

  4. Thank you for this. I knew it had to be in a config somewhere. My Nexus 4 was already rooted so i just downloaded a terminal app, granted it sudo rights with SuperSu, mounted as writable, made a backup copy of the file, added that line to the end (without the angle brackets) in vi, then saved and re-mounted and rebooted my phone and it worked perfect. Thanks a ton for the writeup! Although i might not suggest this to newbies to programming. If your phone “won’t boot” then you must likely made a simple mistake. But if you didn’t backup the file and you don’t know how to restore it from a terminal in fast-boot mode, then you could be toast.

  5. This fucked up my phone. It wouldn’t be able to get past the company branding of my carrier. >.> Thanks a lot. replacing the original build.prop won’t fix shit either.

    1. Ouch. The simplest solution for you now would be to get your phone’s ftf from xda and flash it. You would need titanium backup for backup and restore your data.

      But the funniest part is how it didn’t work for you. I did this on two phones of mine and it worked for me.

      If you have CWMR (or any other recovery), try wiping dalvik cache and reboot. It should solve the problem.

    2. Perhaps this had to do with the end line character? I’m just brainstorming here but if this is done on a Windows machine perhaps this^ build.prop had incompatible characters?
      EDIT: Looks like someone mentioned this further down in the comments

    3. I had the same problem as you. The issue turned out to be caused by the permissions on the file I pushed. it should be -rw-r–r– not -rw-rw-r–

Have something to add? Do it here.

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

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑

%d bloggers like this: