Find the answer to your Linux question:
Results 1 to 5 of 5
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    hostname via dhcp

    Hello there

    I am thinking and searching for this problem for quite a while now, but I donīt have a clue how to solve it. I hope someone can help me.

    What do I want:
    We have a pool of hosts which all have identical images. I want every machine to have a unique name like host01, host02, etc.

    What I have:
    A dhcp-server running on ubuntu 8.04. All hosts are running debian.
    config on the debian server:
    /host host1 {
    use-host-decl-names on;
    hardware ethernet 00:21:86:xx:xx:xx;

    what happens:
    the dhcp itself works perfectly fine. The clients donīt get or donīt take their names from the server. I removed the /etc/hostname file and the only thing that happens, is that the clients call themselves none.

    my questions:
    Is it possible, that the clients get their names via dhcp? (Iīve read yes and no while searching for that answer)
    If it is possible, how do I do that?
    If it is not possible, what would be a good way to do it?

    thanks for the help,
    Last edited by knispel; 01-21-2011 at 03:46 PM.

  2. #2
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    I'm a RHEL/Fedora guy, and don't know the current situation on this in Debian distros. BUT this issue was the source of quite a row around Fedora 9 a couple of years ago. It used to "just work" when the older "network" service was in charge and the static hostname was set to localhost.localdomain or just localhost. When the NetworkManager service became the default it broke, and apparently needed to because the network startup was happening in parallel with the X and gdm startups, and X/gdm got all kinds of weirded out when the hostname changed during startup. People were reporting multiple copies of gdm getting launched, but without an actual graphical desktop coming up. It was claimed to be fixed in F10, but I haven't tried it since it broke.

    If your dhcp server is doing dynamic DNS updates, you can get the hostname with ipcalc --silent --hostname <address> (pulling the address from ifconfig) , but if you try to grab it and set it via e.g. "hostname $HOSTNAME" you'd better be sure that's done before X begins to start up or after the graphical desktop is up (there's probably some legacy X stuff out there that will break if hostname changes after startup, but the real deal killers seemed to happen if it changed _during_ startup).

    I hope some Debian guru here can tell you to just do thus-and-so to make it work in your situation.

  3. #3
    I'm no guru but having investigating some network issues lately with Debian I learned that if you're using dhclient as you're dhcp client there's a 'request host-name' line you can configure on your client. Check 'man dhclient' and 'man dhclient.conf' if you want to find out more.

  4. $spacer_open
  5. #4

    thanks for the help. MEanwhile I found out, that everything in my congifiles is correct and it works perfectly with ubuntu as a client. This seems to be a debian bug, that has been fixed with ubuntu, but not with debian itself.
    If there is not any really good suggestion coming up, I will just give up and try again with a newer debian-version in the future.

  6. #5
    Quote Originally Posted by Gordon.Casper View Post
    olacelle is right, keep in mind the request host name
    This option is set and it is correctly set, buit it still doesnīt work. This really seems to be a debian bug. I will report it to the debian developers soon and perhaps the know a workaround or fix it in one of the next releases.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts