note that joe's example brings up the interface before starting the name server program, and bringing it down if the name server program exits. this presumes that the name server will start very quickly, and that while running, it is healthy. since i've seen name server programs be unhealthy while running, and/or take a long time to start, i'm now considering an outboard shell script that runs some kind of DNS query and decides, based on the result, whether to bring the dedicated loopback interface up or down.
All deference to this model, we've all seen these kinds of problems with name servers. We *can* be certain that bringing a loopback interface up or down takes almost no time (with the implied effect to a speaker like Quagga). There is *no* reason with a sufficiently deep name server depth (depends on your load) that your monitoring script should *need* to hurry to test this condition. Every 5-10 or even 15 minutes to see if its eligible to bring up, more frequently to see if its eligible to take down. This also reduces oscillation. This means, bring up/kill off your name server in one cronjob (automatically taking the interface down at the end or after a kill), and monitor/talk to the interface in another (up function and sometimes the down). You'll be much happier. Deepak Jain AiNET