Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 366999 - DHCP hostname should be relatively unique between systems
Summary: DHCP hostname should be relatively unique between systems
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Release Media
Classification: Unclassified
Component: InstallCD (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo Release Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-12 16:11 UTC by Michael Mol
Modified: 2017-02-06 20:35 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Mol 2011-05-12 16:11:29 UTC
Currently, the install CD sets up a hostname of 'livecd'. When DHCP is used, the DHCP client sends 'livecd' as the system hostname.

In an environment such as mine where the DHCP server updates DNS records, this results in a new A record looking like livecd.firefly.michael.mol.name. This is actually pretty slick, but it brings to mind a problem...what if I'm setting up multiple systems at once? The DHCP server updates DNS under the assumption that no two different hosts will use the same hostname.

Android phones get around this by appending the MAC address to their reported hostname. I'd be happy to see either a MAC address or some other randomizing element (such as a GUID, or even four bytes from /dev/urandom converted to hex).

Reproducible: Always

Steps to Reproduce:
1. Boot install CD
2. Use DHCP to attach to local network
3. observe the DHCP client's reported hostname
Actual Results:  
DHCP client reports 'livecd' as the hostname

Expected Results:  
Report something like 'livecd-hhhhhhhhhhhhhh' where h+ is a MAC address.

or

Report something like 'livecd-uuuuuuuu-uuuu-uuuu-uuuu-uuuuuuuuuuuu' where uuuuuuuu-uuuu-uuuu-uuuu-uuuuuuuuuuuu is a GUID.

or

Report something like 'livecd-xxxxxxxx' where xxxxxxxx is four bytes from /dev/urandom in hexadecimal format, making eight bytes.

or

Report something like 'livecd-bbbbbb' where bbbbbb is four bytes from /dev/urandom converted to Base64 with the trailing == truncated, making six bytes.

Handled properly, this would result in livecd-(whatever) being the hostname portion of $PS1 at boot time, making distinguishing between livecd hosts on the command-line easier.
Comment 1 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-05-12 16:20:25 UTC
I'll wait for the opinion of other releng members, but this is very low priority to me. I'd say that on enterprise environments the sys admins should not be relying in the hostname used by the live-cd but use central tools.
One solution that comes to mind is adding dhcp reservations for the mac address of the systems being installed.
Comment 2 Michael Mol 2011-05-12 16:56:32 UTC
Not an enterprise scenario, just me and my odd home network. (I like using DNS for resolution of hosts and their IPs, but I don't want to have to edit things every time I add or remove a host. You might be surprised how handy this setup is!) It'd be handy if I were in the process of installing multiple Gentoo boxes, or hosted a Gentoo installfest. (And given my recent experience using distcc during bootstrap, I've been considering just that!)

It's also closer to being a "good neighbor" on a local network. Another reasonable solution would be to not provide a hostname in the DHCP request at all. (A friend's Vista laptop doesn't, for example)

I agree it's not a high priority, though. I'm used to being an edge case. I might figure out how to do it myself and provide a patch, if that seems likely to be accepted.
Comment 3 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2017-02-06 20:35:58 UTC
In almost 6 years, there were no more comments here and I don't think anyone has worked on this, so I'm going to close with WORKSFORME.