Democratic Underground Latest Greatest Lobby Journals Search Options Help Login
Google

Take that ISP!!! - Scripts of necessity for the house.

Printer-friendly format Printer-friendly format
Printer-friendly format Email this thread to a friend
Printer-friendly format Bookmark this thread
Home » Discuss » DU Groups » Computers & Internet » Open Source and Free Software Group Donate to DU
 
MazeRat7 Donating Member (1000+ posts) Send PM | Profile | Ignore Thu Nov-18-04 04:59 PM
Original message
Take that ISP!!! - Scripts of necessity for the house.
So for the past month or so my cable ISP has been changing DNS servers on me like once or twice a week. Since I use dhclient (RedHat) to get leases from them and it updates resolv.conf...no problem for my front box. However, all the dhcp clients on my local network stop working because the dhcpd.conf file now has the wrong name server entries.

Well, I got tired of going in editing and restarting dhcpd and thought I would share my solution in case anyone else has had the same issue.

The fix goes like this (on a RedHat system at least)...

dhclient manages leases and also calls /sbin/dhclient-script (which is who generates the local resolv.conf file). Hiding inside dhclient-script is a call out to /etc/dhclient-exit-hooks and /etc/dhclient-enter-hooks. Yup, the rest should be obvious, create a dhclient-exit-hooks file to read the nameservers from resolv.conf, update dhcpd.conf, and then restart the local dhcpd.

I will add, rather then doing all that in shell script, I simply called a perl script to do all the heavy lifting for me. Which of course I am willing to share if anyone is interested.

Ok thats it. Just one of the petty problems that when you get really tired of... you go and fix.

MZr7


Refresh | 0 Recommendations Printer Friendly | Permalink | Reply | Top

Home » Discuss » DU Groups » Computers & Internet » Open Source and Free Software Group Donate to DU

Powered by DCForum+ Version 1.1 Copyright 1997-2002 DCScripts.com
Software has been extensively modified by the DU administrators


Important Notices: By participating on this discussion board, visitors agree to abide by the rules outlined on our Rules page. Messages posted on the Democratic Underground Discussion Forums are the opinions of the individuals who post them, and do not necessarily represent the opinions of Democratic Underground, LLC.

Home  |  Discussion Forums  |  Journals |  Store  |  Donate

About DU  |  Contact Us  |  Privacy Policy

Got a message for Democratic Underground? Click here to send us a message.

© 2001 - 2011 Democratic Underground, LLC