NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

FQDNs for netbooted hosts via DHCP?



I have historically used dhcpd.conf "host" entries like:

  option domain-name "example.com";

  option domain-name-servers M.N.O.P, W.X.Y.Z;

  host foo {
    hardware ethernet xx:xx:xx:xx:xx:xx;
    fixed-address A.B.C.D;
    option next-server P.Q.R.S;
    option root-path "/path/to/foo";
  }

  group bar {
    option host-name "bar";
    option next-server P.Q.R.S;
    option root-path "/path/to/bar";

    host bar-if0 {
      hardware ethernet 01:23:45:67:89:AB;
      fixed-address F.I.D.O;
    }

    host bar-if1 {
      hardware ethernet 01:23:45:67:89:CD;
      fixed-address F.I.D.O;
    }
  } # group bar

When hosts "foo" or "bar" boot from local disk and configure their
network interfaces via DHCP ('dhcpcd'), they get an FQDN: "foo.example.com"
or "bar.example.com", respectively.  (No "hostname=..." in "/etc/rc.conf".)

When either host netboots, the in-kernel DHCP client gets hostname "foo"
or "bar" and domain "example.com", but the machines' names are only the
short "foo" or "bar" and not the FQDN.

At least on netbooted i386/amd64 machines it is possible to configure
the interface again using 'dhcpcd'.  In such case, the machines' names
remain the short "foo" or "bar" and not the FQDN.

I ran into this issue while taking early steps at configuring local
PostFix as a null client when "relayhost = $mydomain" didn't work since
the machine was netbooted and had only its short name.

So far, I can only get an FQDN for netbooted machines if I make the
"host" entries:

  host foo.example.com {
    ...
  }

  group bar {
    option host-name "bar.example.com";
    ...
  }

which is a lot of duplication for all the potential netbooted hosts I
may have.

Grovelling the "dhcpd.conf" and "dhcp-options" manual pages, it seems
that all the options related to "host{,-}name" and "domain-name" and
"fqdn" are all about the client telling the server what its name should
be instead of the other way around (which is what I want).

Any tips on getting netbooted hosts an FQDN with just the short name
in a "host" entry or "option host-name" statement in "dhcpcd.conf"?

Thanks.

-- 
|/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
|\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
| X  No HTML/proprietary data in email.   BSD just sits there and works!
|/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645



Home | Main Index | Thread Index | Old Index