Mailing List Archive

DHCP Hostname
Hey folks,

On my desktop, I pop the following into my /etc/dhcp3/dhclient.conf

send host-name "<hostname>";

This allows me to locate my machine on the LAN by its hostname.

I've done the same on my N810, to no avail. Is the dhcp setup a little
different?

--
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com
Re: DHCP Hostname [ In reply to ]
On Fri, Nov 05, 2010 at 03:35:42PM -0700, Kip Warner wrote:
> On my desktop, I pop the following into my /etc/dhcp3/dhclient.conf
>
> send host-name "<hostname>";
>
> This allows me to locate my machine on the LAN by its hostname.
>
> I've done the same on my N810, to no avail. Is the dhcp setup a little
> different?

Maemo uses udhcpc instead, but it does send the hostname by default - here's
what the DISCOVER request looks like with tshark -V:

Bootstrap Protocol
[...]
Option: (t=53,l=1) DHCP Message Type = DHCP Discover
Option: (53) DHCP Message Type
Length: 1
Value: 01
Option: (t=61,l=7) Client identifier
Option: (61) Client identifier
Length: 7
Value: 01001D6EXXXXXX
Hardware type: Ethernet
Client MAC address: NokiaDan_XX:XX:XX (00:1d:6e:XX:XX:XX)
Option: (t=12,l=15) Host Name = "Nokia-N810-43-7"
Option: (12) Host Name
Length: 15
Value: 4E6F6B69612D4E3831302D34332D37
[...]

This is done by /usr/lib/icd2/libicd_network_ipv4.so (passed as a -H
argument to udhcpc) which you can't change, but if you want to send a
different one you can always set the real hostname to that via
/etc/hostname and reboot.

L.
_______________________________________________
maemo-users mailing list
maemo-users@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-users
Re: DHCP Hostname [ In reply to ]
On Sat, 2010-11-06 at 18:26 +0000, Lucas Maneos wrote:
> Maemo uses udhcpc instead, but it does send the hostname by default - here's
> what the DISCOVER request looks like with tshark -V:
>
> Bootstrap Protocol
> [...]
> Option: (t=53,l=1) DHCP Message Type = DHCP Discover
> Option: (53) DHCP Message Type
> Length: 1
> Value: 01
> Option: (t=61,l=7) Client identifier
> Option: (61) Client identifier
> Length: 7
> Value: 01001D6EXXXXXX
> Hardware type: Ethernet
> Client MAC address: NokiaDan_XX:XX:XX (00:1d:6e:XX:XX:XX)
> Option: (t=12,l=15) Host Name = "Nokia-N810-43-7"
> Option: (12) Host Name
> Length: 15
> Value: 4E6F6B69612D4E3831302D34332D37
> [...]
>
> This is done by /usr/lib/icd2/libicd_network_ipv4.so (passed as a -H
> argument to udhcpc) which you can't change, but if you want to send a
> different one you can always set the real hostname to that via
> /etc/hostname and reboot.
>
> L.

Hey Lucas. Thanks a lot for your help. I edited /etc/hostname, but after
rebooting, if I run hostname, it just prints out a blank line. Ideas?

--
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com
Re: DHCP Hostname [ In reply to ]
On Sun, Nov 07, 2010 at 10:46:33AM -0800, Kip Warner wrote:
> Hey Lucas. Thanks a lot for your help. I edited /etc/hostname, but after
> rebooting, if I run hostname, it just prints out a blank line. Ideas?

Make sure /etc/hostname only contains the desired hostname on a single
line, with no extra white space. To quickly test without rebooting try
"hostname -F /etc/hostname ; hostname" after editing.

L.
_______________________________________________
maemo-users mailing list
maemo-users@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-users
Re: DHCP Hostname [ In reply to ]
On Sun, 2010-11-07 at 19:20 +0000, Lucas Maneos wrote:
> Make sure /etc/hostname only contains the desired hostname on a single
> line, with no extra white space. To quickly test without rebooting
> try
> "hostname -F /etc/hostname ; hostname" after editing.
>
> L.

Hey Lucas. It worked this time. I think I had an extraneous newline
character at the end. It's a little silly that hostname doesn't issue a
warning in that case.

Thanks a lot for your help.

--
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com