On Mon 03 Feb 2003 at 23:59:01, Matt W. said:
> I'd like to dynamically get the DNSs
> received from my ISP into my dhcpd.conf.  This would account for DNS server
> changes, and for varying numbers of DNS servers.

If you're using dhclient as your DHCP client, you can create a script
called "/etc/dhclient-exit-hooks" that runs after dhclient has obtained
or renewed its DHCP lease.  This is just a regular Bourne shell script
that receives a whole bunch of environment variables [0] from dhclient,
and you can use it to make other necessary system changes based on the
new IP information.  I, for instance, have it reconfigure my firewall if
the IP address has changed, and it also runs a PERL script to update my
dynamic hostname.  You could easily use it to update your dhcpd.conf
file to point to the new nameservers.

Of course I have no idea how much all -- of any of this -- applies if
you're using pump instead of dhclient.  I don't have any machines that
use pump.

[0] The environment variables are described in "man dhcp-options" as the
dhcp options.  Just replace all the - with _ like so:

DHCP option       script variable
-----------       ---------------
new-ip-address -> $new_ip_address

I think the domain-name-servers option will be of specific interest to
you in this case.

-- 
Soren Harward
[EMAIL PROTECTED]

____________________
BYU Unix Users Group 
http://uug.byu.edu/ 
___________________________________________________________________
List Info: http://phantom.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to