Re: Instructing dhclient to set hostname of client



Brooks Davis wrote:
On Tue, Oct 24, 2006 at 09:16:07AM +0200, Harti Brandt wrote:
On Mon, 23 Oct 2006, Joe Holden wrote:

JH>Andrey V. Elsukov wrote:
JH>> Doug Barton wrote:
JH>>> If you're talking about a laptop where you're not sure what the DHCP
JH>>> server is going to send you, then I have this in /etc/rc.local:
JH>>
JH>> Hi, Doug.
JH>>
JH>> What you think about adding a new feature to dhclient - Alternate IP
JH>> Configuration. This configuration can be specified in dhclient.conf
JH>> and take effect when a DHCP server not respond. MS Windows have a
JH>> similar feature.
JH>>
JH>Really I was hoping dhclient would have this sort of functionality where
JH>it would resolve the ip given and set that as hostname, as as far as im
JH>aware, isc-dhcpd will not send hostnames?

Sure it does. On my machines I set hostname to "" in rc.conf and let
dhclient set it. Works fine.

Once upon a time I implemented some code to add a default_hostname
variable to rc.conf which was then used by the startup scripts and
dhclient-script to allow the local network to override the name if
desired while insuring that the system had a name at all times (required
for laptop use). I'd take patches to do this.

-- Brooks

P.S. hacking this into rc.local won't work longterm because addresses
will be assigned in a totally different context.

I wrote an rc.d script called updatehost that does this, its called
after other net scripts, and basically gets the ip from $interface (set
by updatehost_flags="blah0" in rc.conf, and resolves that, seems to
work, a dirty hack but it does the trick.

Thanks,
Joe
_______________________________________________
freebsd-net@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Instructing dhclient to set hostname of client
    ... JH>>> If you're talking about a laptop where you're not sure what the DHCP ... JH>> What you think about adding a new feature to dhclient - Alternate IP ... JH>it would resolve the ip given and set that as hostname, ...
    (freebsd-net)
  • Re: Instructing dhclient to set hostname of client
    ... JH>>> If you're talking about a laptop where you're not sure what the DHCP ... JH>> What you think about adding a new feature to dhclient - Alternate IP ... On my machines I set hostname to "" in rc.conf and let dhclient set it. ...
    (freebsd-net)
  • Re: DNS problem on local network
    ... Remove domain-name-servers from that list and dhcp wont supply it. ... My problem is that the DHCP and DNS server running dnsmasq is actually the gateway server and has a second NIC connected to a modem, from which it gets its ip via DHCP, hence the reason why this box is running dnsmasq for one NIC and dhclient3 for the other. ... I now have to figure out what is happening on the dhclient front on my workstations, or at least my linux workstation since that has no concept of its domain name still. ...
    (Debian-User)
  • Re: Problems with OpenBSD dhclient
    ... > been having some issues with managing my network connection. ... DHCP is not playing, yet. ... > When I go to a meeting, I want to switch to the wireless network. ... > Now life is not so nice with the OpenBSD dhclient. ...
    (freebsd-current)
  • Re: Marvell 88E80856 switching from static to dhcp configuration all on its own
    ... 3Com handles dhcp and dns requests. ... have both interfaces using static ip, dhclient shouldn't even be ... Isn't there some process watching the settings in /etc/network/interfaces to stop just such a thing from happening, or doesn't the driver and device itself record its state so that dhclient wouldn't even attempt this unless there is some type of user override, ...
    (Debian-User)