• September 26, 2023

Device Hostname Android

How to set friendly network name of android computer?

I see names of computers in my router’s DHCP leasing list. My android galaxy tab is listed under an alphanumeric name. How do I set a friendly name that I like?
asked Apr 4 ’12 at 15:03
On Android 4. 4 and lower, you can change the hostname to a less cryptic name in the Developer Options under Settings. Under the “Debugging” section in the Developer Options you will see an option called “Device hostname” which should currently be set to this rather cryptic name. You can change it to any alpha numeric name you like.
If you are on Android 5. 0, that option is not there anymore. Though using the ADB shell still works. See bayuah’s answer. Root doesn’t seem to be required on my phone. From the answer linked above:
adb shell
getprop name
setprop name
wjandrea5686 silver badges19 bronze badges
answered Jan 22 ’13 at 15:45
timonskutimonsku6288 silver badges13 bronze badges
Open terminal. Enter the following:
Root access is required.
answered Jan 12 ’15 at 11:26
bayuahbayuah1811 silver badge5 bronze badges
Hostname is used to easily identify and remember hosts connected to a network. It’s set on boot, e. g. from /etc/hostname on Linux based systems. Hostname is also a part of DHCPREQUEST (standardized as code 12 by IETF) which a DHCP client (Android device in our case) makes to DHCP server (WiFi router) to get an IP address assigned. DHCP server stores the hostnames to offer services like DNS. See details in How to ping a local network host by hostname?.
Android – instead of using Linux kernel’s hostname service – used property name (since Android 2. 2) to set a unique host name for every device which was based on android_id. This hostname property was used for DHCP handshake (as added in Android 2. 2 and 4. 0). In Android 6 name continued to be used (1, 2, 3, 4) in new Java DHCP client when native dhcpcd was abandoned and later service was removed in Android 7. Since Android 8 – when android_id became unique to apps – name is no more set, so a null is sent in DHCPREQUEST. See Android 8 Privacy Changes and Security Enhancements:
name is now empty and the dhcp client no longer sends a hostname
So the WiFi routers show no host names for Android 8+, neither we can set / unset / change it.
However on rooted devices you can set name manually using setprop command or add in some init’s file to set on every boot. Or use a third party client like busybox udhcpc to send desired hostname and other options to router. See Connecting to WiFi via ADB Shell.
answered Nov 22 ’19 at 20:36
Irfan LatifIrfan Latif2313 silver badges10 bronze badges
In some Android phones, you may change in Wi-Fi Direct
Top right menu > Advanced
Wi-Fi Direct
Top right option Rename device
Write your new device name and press OK
Turn off and on your Wi-Fi
If it has no effect, restart your phone.
Important: Not all Android phones have this option, and not all phones modify their hostname correctly, even after modifying the device name from that option.
answered Mar 2 ’18 at 10:51
Paulo CoghiPaulo Coghi9541 gold badge10 silver badges14 bronze badges
The name that is sent to the DHCP server is not the hostname as is commonly thought, it’s the VID (Vendor ID Code) which you cannot change. You could try changing the name at the router level if possible.
answered Apr 4 ’12 at 15:20
paradd0xparadd0x8, 6436 gold badges34 silver badges43 bronze badges
This solution is using the commands posted by @bayuah above, but not using adb nor su at all.
This is on a rooted device (Nougat AOSP 7. 1. 2).
Using JuiceSSH terminal, enter two commands:
answered Apr 7 ’18 at 22:25
On my Galaxy Edge S7 the device friendly name can be changed under “About phone” (near the bottom of the Settings menu):
Since I configured it to “Matthijs mobiel”, our local router gave me the hostname “”. Unfortunately it sounds like your router might be assigning a name based on MAC address rather than based on the device friendly name, in which case this probably won’t help (though you can try configuring a name that’s a valid hostname already, perhaps it will work).
answered Feb 19 at 22:43
MatthijsMatthijs2362 silver badges5 bronze badges
Simply download and install the app called “Change Hostname” from the Play Store and enjoy editing your android device hostname (android-xxxxxxxxxxx).
Root access is required though, sorry for the non-rooted users.
answered Feb 8 ’13 at 2:35
Not the answer you’re looking for? Browse other questions tagged networking android or ask your own question.
How do I change the name of my Android device?

How do I change the name of my Android device?

getprop name (Android System Hostname, likely android_24412414 type name)
echo $HOSTNAME (shell/terminal/env hostname, likely from)
cat /proc/sys/kernel/hostname (Linux System Hostname, likely localhost)
head /etc/hosts (Linux System Hostname, likely localhost)
hostname (Command not always installed, if installed via busy box, will read /proc/sys/kernel/hostname)
Depends on which version of Android you have.
Android 4. 0 and Above
Newer versions will use the right entry. Well, that is to say, Android reads the as it’s normal boot process. Once the Connectivity Service runs, it checks to see if name 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 name=HOSTNAMEHERE to /system/ (Root may be needed). Leave a blank line at the end of the file.
Kitkat’s, notice the IF isEmpty statement:
// setup our unique device name
if (Empty((“name”))) {
String id = (tContentResolver(), );
if (id! = null && () > 0) {
String name = new String(“android-“)(id);
(“name”, name);
Android 2. 3 and Below
Older versions, Gingerbread, Froyo, etc, just clobber it. It doesn’t bother to check. It will set name 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 name 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.
String name = new String(“android_”)(id);
But then there is another issue.
The name 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 which runs hostname localhost, so all underneath commands will not see either your 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. 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), and it will not provide a hostname to the dhcp server if $(hostname) (The hostname command) is blank or localhost, and it does not internally use name. libnetutils is used for calling dhcpcd with -h “name”, 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.
My Solution for Gingerbread and below Samsung, Edit the DHCP Client Daemon config:
The last thing you can do is edit /etc/dhcpcd/ 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). You will need Root, but this works across reboots. This won’t work if dhcpcd is called with -h Hostname option.
Change Device Name on Android for WiFi / Bluetooth / Hotspot

Change Device Name on Android for WiFi / Bluetooth / Hotspot

In this tutorial, we’ll see how we can change Android device name under device settings. Besides, we’ll also be describing the way to change WiFi Direct and Hotspot network name and the Bluetooth connection name for Android devices.
Wi-Fi and Bluetooth are the most used modes of connectivity features on smartphones for sharing internet data and transferring files from one device to another. If you scan for a Wi-Fi or Bluetooth connection with your Android phone or tablet, you will see either a generic or customized name of the detected devices. If you are new to Android, this little tutorial will help you assign a customized name for your Android phone or tablet that will be shown when other devices scan for yours. Let’s see how we can change device name for WiFi, Bluetooth, mobile hotspot or tethering.
There is nothing twisted about setting up a device name for WiFi and Bluetooth connection and that’s why I call it a beginner’s guide. If you are a smart Android user, please do not cross beyond this point. All options are already existing under phone settings, I will just be telling you how to dig into it.
Editor’s Pick: How to Find the IP Address of Android Devices
Change Android Device Name from Settings
The easiest way to change the device name of your Android device is by doing it from the About phone screen itself. Open Settings on your phone or tablet, scroll to About phone or device and tap on it. On the next screen, tap on Device Name, and then type the desired name for your device in the text field and select OK.
Change Android Device Name – OnePlus 6
Please Note: If you have a Samsung Galaxy device, you need to change the device name only and your Bluetooth name and WiFi Direct name will be automatically set. Go to Settings> About Phone and tap the Edit option under the device name. Type your custom device name and select Done.
Change Android Device Name – Samsung Galaxy S9+
Don’t Miss: Huge List of All ADB and Fastboot Commands
Changing Bluetooth Name
To be able to edit the settings for Bluetooth, you will have to turn it on first. Bluetooth can also be enabled by tapping on the slider from Settings> Bluetooth.
Open Settings on your Android device and tap on Bluetooth option.
Tap the Device name and enter the new name for your phone or tablet and tap OK. On OnePlus devices, you’ll be able to see the Device name after selecting Pair new device option. On some Android devices other you need to tap the 3-dot vertical menu icon to see the device rename option.
Change Bluetooth Name on Android
Change WiFi Direct Name on Android
Assigning the desired device name is pretty much the same as that of Bluetooth. Let’s see how you can do it.
Again, to edit WiFi settings, you will have to enable it first. Go to your device’s Settings panel and tap on the toggle slider to enable it
Next, tap on the “Wi-Fi” text to see the configuration screen.
Tap on “Wi-Fi Direct”, or launch options menu to see the “Wi-Fi Direct” option (for AOSP) and then tap on it.
Now tap on the 3-vertical-dot menu icon to see the “Rename Phone” or “Rename Device” option.
Type in the preferred name in the text box and select OK to save it.
Must Read: What is NFC and How to Use it in Awesome Ways
Change WiFi Hotspot Name on Android
If you want to customize your Android phone’s name for WiFi hotspot and tethering, go to Settings> Mobile/Wi-Fi Hotspot and Tethering and turn it on. Then tap the Hotspot name option and type the name you want to show. On some Android phones, you need to tap the 3-dot menu icon and select Configure Mobile Hotspot option to replace the existing name with a name of your choice.
So here ends our easy tutorial, if it really is, for beginners. We just hope it helps to change your Android device name. Bluetooth name, Hotspot name, and WiFi Direct name. For more useful tips and tricks for Android devices, do not forget to take a tour of our useful tutorials. Cheers!
Do you know, you can transfer data faster than Bluetooth using WiFi Direct?
Read Next: 5 Best Magisk Modules You Must Try
Reader Interactions

Frequently Asked Questions about device hostname android

How do I find my hostname on Android?

What is my devices hostname?

How do I find my mobile host name?

Leave a Reply

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