Found a method for a different phone that also works for the Droid 4. Original post is here [SCRIPT] Change Hostname - xda-developers.
This is handy if you have multiple android devices connected to your router. Instead of cryptic names, you can change them to something more easily identifiable.
This does require root.
Using Script Manager, add the following code to run as SU and on start-up.
QR Code for Script Manager
http://qrcode.kaywa.com/img.php?s=8&d=http://pastebin.com/raw.php?i=C76ZjxdQ
This is handy if you have multiple android devices connected to your router. Instead of cryptic names, you can change them to something more easily identifiable.
This does require root.
Using Script Manager, add the following code to run as SU and on start-up.
Code:
#!/system/bin/sh#change devName to whatever you want.
devName=Droid4
if [ "$(/system/xbin/hostname)" = "$devName" ] && [ "$(getprop net.hostname)" = "$devName" ]
then
echo "Device hostname does not need to be changed."
else
echo "Device hostname is being changed to $devName."
/system/xbin/hostname $devName
setprop net.hostname $devName
if [ "$(/system/xbin/hostname)" != "$devName" ] && [ "$(getprop net.hostname)" != "$devName" ]
then
echo "Device hostname has not been changed."
else
echo "Device hostname has been successfully changed."
fi
fi
QR Code for Script Manager
http://qrcode.kaywa.com/img.php?s=8&d=http://pastebin.com/raw.php?i=C76ZjxdQ