webOS Nation Forums >  webOS Developers >  webOS Development > Friendly Hostname for Pre?
Friendly Hostname for Pre?
  Reply
 
Thread Tools Display Modes
Old 06/17/2009, 03:02 PM   #1 (permalink)
Member
 
mdmogren's Avatar
 
Posts: 500
This is probably simple, but is there a way to assign a friendly host name (computer name) to the pre so I can use that to access it instead of an ip address? Having to figure out the IP that got assigned to the pre on each wireless network you connect to is a huge pain.

Thanks!
mdmogren is offline   Reply With Quote
Old 06/17/2009, 04:28 PM   #2 (permalink)
Member
 
i700plus's Avatar
 
Posts: 156
Bam! Kazam! here you go!

pre dev wiki: Update DNS hostname from Sprint IP

Now keep in mind this is for EVDO access only... local access will still get assigned a local IP address.
__________________
<I accidentally the whole pre>

<Palm Pre Speed Test>

i700plus is offline   Reply With Quote
Old 06/17/2009, 08:43 PM   #3 (permalink)
Member
 
mdmogren's Avatar
 
Posts: 500
Yea, i'm looking for something that will do it locally. I know there has to be a setting, any linux network guru's here to point me in the right direction?
mdmogren is offline   Reply With Quote
Old 06/17/2009, 10:34 PM   #4 (permalink)
Member
 
Posts: 44
It's a client setting, not a setting on the Pre. On Linux (and maybe Mac too) you can use /etc/hosts.
ydaraishy is offline   Reply With Quote
Old 06/17/2009, 11:22 PM   #5 (permalink)
Member
 
mdmogren's Avatar
 
Posts: 500
Quote:
Originally Posted by ydaraishy View Post
It's a client setting, not a setting on the Pre. On Linux (and maybe Mac too) you can use /etc/hosts.
So you're saying I should look in /etc/hosts on the pre? Is the Pre not the client here???
mdmogren is offline   Reply With Quote
Old 06/17/2009, 11:58 PM   #6 (permalink)
Member
 
Posts: 44
If you're connecting from a computer to your Pre, your computer, NOT the Pre, is responsible for mapping names into IP addresses. (Your Pre is acting as an SSH/whatever server here, and your computer is the SSH/whatever client).

If your computer is running Linux or Mac or any other OS with an /etc/hosts file, you can add an entry in this so that you can use a "normal" name that gets manually resolved to your Pre's IP address. There may be a way to do this on Windows, but I don't know it.
ydaraishy is offline   Reply With Quote
Old 06/18/2009, 02:12 AM   #7 (permalink)
Member
 
mdmogren's Avatar
 
Posts: 500
Quote:
Originally Posted by ydaraishy View Post
If you're connecting from a computer to your Pre, your computer, NOT the Pre, is responsible for mapping names into IP addresses. (Your Pre is acting as an SSH/whatever server here, and your computer is the SSH/whatever client).

If your computer is running Linux or Mac or any other OS with an /etc/hosts file, you can add an entry in this so that you can use a "normal" name that gets manually resolved to your Pre's IP address. There may be a way to do this on Windows, but I don't know it.
Clearly I could create a manual dns entry for a specific ip address on the client but that's pretty lame, the entire point here is for when I'm on different networks and don't know the IP. If I take my computer to your house and get on your wifi you can ping it using the COMPUTER NAME which comes from MY computer - all OSes support this including linux, for example, I have a linux box named usat-ubuntu - so how do I create a "computer name" for the pre?
mdmogren is offline   Reply With Quote
Old 06/18/2009, 02:20 AM   #8 (permalink)
Member
 
Posts: 44
This is because you're on your own network and DHCP and DNS are working together on your wifi router and is assigning you a domain name (*different* from your hostname)

On a network you don't control, you can't change the DNS entries yourself, or you may not ever be given a DNS name, or you may never know the network's DNS name, etc.

Your pre's hostname is "castle", maybe you can try pinging castle without a domain name and seeing if that would work, provided DHCP is setting you with a search domain when you log on to that network.
ydaraishy is offline   Reply With Quote
Old 01/20/2010, 05:46 PM   #9 (permalink)
Member
 
Posts: 37
I also have a wish for this - does anybody know how to be sure the pre reports a host name when obtaining IP over DHCP with Wifi? In my case I would like this so that when I look from my router what all the connected wi-fi devices I will know which one is the pre instead of having to recall the MAC address.

My router is basic so it does not provide DNS options or internal MAC alias naming either.

It 'should' come from the NAME entry under Device Information on the Pre, but I even changed that to a simple name without spaces thinking that would help.

Last edited by natsteff; 01/20/2010 at 06:03 PM.
natsteff is offline   Reply With Quote
Old 01/22/2010, 02:15 AM   #10 (permalink)
Member
 
mdmogren's Avatar
 
Posts: 500
Quote:
Originally Posted by ydaraishy View Post
This is because you're on your own network and DHCP and DNS are working together on your wifi router and is assigning you a domain name (*different* from your hostname)

On a network you don't control, you can't change the DNS entries yourself, or you may not ever be given a DNS name, or you may never know the network's DNS name, etc.

Your pre's hostname is "castle", maybe you can try pinging castle without a domain name and seeing if that would work, provided DHCP is setting you with a search domain when you log on to that network.
This is super old, but to say that on a network you don't control you can't change DNS entries is very misleading - that may be true in very locked down corporate networks or public wifi hotspots with smart admins, but 99% of all networks that you'll connect to the dns server will accept dynamic updates from any clients that are connected.
mdmogren is offline   Reply With Quote
Thanked By: drahgon
Old 05/31/2010, 08:37 AM   #11 (permalink)
Member
 
Posts: 28
I have managed this with wi-fi networks. i.e. when I enable wi-fi on my palm and connect to a known wi-fi network, once the palm is connected, on another computer I can ping my palm using "ping palm-webos-device" and ssh into it with "root@palm-webos-device". (My v1.4.1.1 Palm Pre has a hostname of "palm-webos-device", not "castle".) How did I do this: I followed the advice on (because of the dumb restriction on posting links I have to baffle the silly system) https : // calomel . org / dhclient . html, with my own additions. Note that this only works on suitably configured DHCP-based networks with suitably configured computers on the network.)

1. Set your root parition on your palm pre to read-write.
2. Backup then edit the file "/etc/PmWiFiDhclient.conf", adding the lines, in the following order:

send host-name "palm-webos-device";
supersede host-name "palm-webos-device";
request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, host-name;

3. Save the file, and reset the root partition to read-only.
4. Reboot your palm pre (the only way I quickly found to restart the dhclient process on the palm pre, probably other ways, but couldn't be bothered to find out).

Now, using a hostname other than "palm-webos-device" would require editing more files, at least "/etc/hostname" and probably others, which I didn't do.

Once this was done, I installed ssh and the sftp server, and even, on Ubuntu, managed to browse the palm pre's filesystem from another computer on the same-wifi network.

Note that if the palm pre goes to sleep, despite keeping the wifi on whilst asleep, an ssh link to the palm does seem to not respond, which recovers once the palm is awake.
jmmcg is offline   Reply With Quote
Thanked by cowpen, drahgon
Old 02/07/2011, 06:53 AM   #12 (permalink)
Member
 
Posts: 28
I tried the same technique with my Palm Pre 2 replacing palm-webos-device with roadrunner, and it seems to work for it too.
jmmcg is offline   Reply With Quote
Old 02/07/2011, 10:37 AM   #13 (permalink)
Member
 
ggendel's Avatar
 
Posts: 401
If your dhcp server supports a pseudo-static address, then it's much easier than that.

1) Have your dhcp server provide the same address each time it get's a dhcp request for the palm.
2) Add it to /etc/hosts on every machine you want to connect from or:
3) If you have a domain name server, add it to it's table.

This technique makes it easy to have multiple phones, and other devices identified by name on your LAN.

Specifically, on my OpenSolaris server:
1) Use dhcpmgr to add a static IP address for the Palm's MAC address.
2) Add it to my tinydns service.

With this I can ssh to the device by name from any machine on my internal network.
__________________
Palm III->Palm IV->Palm V->M130->Tungsten->Treo 270->Treo 600->Treo 700->Palm Pre Plus->FrankenPre 2->Pre 3 & TouchPad
ggendel is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0