5,600,571 Members 33,176 Now Online
XDA Developers Android and Mobile Development Forum

[Q] changing hostname

Tip us?
 
bigdweeb
Old
#1  
Junior Member - OP
Thanks Meter 1
Posts: 6
Join Date: Jun 2012
Default [Q] changing hostname

Hi,
I'm new to Android, so please bear with me. I just recently picked up a Nexus 4 to play with. It came with 4.2 on it, and I have done the OTA updates to 4.3 and then 4.4. I decided to root the device and followed the instructions here. That all seems to work OK and I can get root using adb.

The first thing I tried to do next was change the hostname from android-something to a hostname that I could remember. I did a bunch of searching here and found the following commands suggested:
Code:
 getprop net.hostname
setprop net.hostname
If I run these commands, the hostname changes. The problem is once I reboot, the name is back to what it was originally. I even tried remounting /system as rw, as I saw in some other post, and running the command again like this:
Code:
mount -o remount,rw -t ext4 /dev/block/mmcblk0p1 /system
setprop net.hostname NEWNAME
mount -o remount,ro -t ext4 /dev/block/mmcblk0p1 /system
I tried rebooting after that and the name change still doesn't stick. What am I doing wrong?
 
luiseteyo
Old
#2  
luiseteyo's Avatar
Recognized Contributor
Thanks Meter 2047
Posts: 2,190
Join Date: Oct 2011
Location: Madrid
Quote:
Originally Posted by bigdweeb View Post
Hi,
I'm new to Android, so please bear with me. I just recently picked up a Nexus 4 to play with. It came with 4.2 on it, and I have done the OTA updates to 4.3 and then 4.4. I decided to root the device and followed the instructions here. That all seems to work OK and I can get root using adb.

The first thing I tried to do next was change the hostname from android-something to a hostname that I could remember. I did a bunch of searching here and found the following commands suggested:
Code:
 getprop net.hostname
setprop net.hostname
If I run these commands, the hostname changes. The problem is once I reboot, the name is back to what it was originally. I even tried remounting /system as rw, as I saw in some other post, and running the command again like this:
Code:
mount -o remount,rw -t ext4 /dev/block/mmcblk0p1 /system
setprop net.hostname NEWNAME
mount -o remount,ro -t ext4 /dev/block/mmcblk0p1 /system
I tried rebooting after that and the name change still doesn't stick. What am I doing wrong?
It shouldn't be changed

Anyway, try this https://play.google.com/store/apps/d...hostname&hl=es
.
.
.
.
.
.
 
bigdweeb
Old
#3  
Junior Member - OP
Thanks Meter 1
Posts: 6
Join Date: Jun 2012
Quote:
Originally Posted by luiseteyo View Post
It shouldn't be changed

Anyway, try this https://play.google.com/store/apps/d...hostname&hl=es
Thanks for the reply. I had seen that there were apps for this, but I figured it would work on the cli if an app could do it.

Why do you say it shouldn't be changed? I've never had a device that you weren't supposed to change the name of.
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes