<div dir="ltr"><div><div><div><div>Well, I am trying to configure DNS System Monitoring stuff with Nagios plugins. This monitor the server status and if any of th link fails remove the said IP from zone and reload the zone. This entry would have low TTL so that traffic would be routed to new entry instantly.<br>
<br>Lets say I have two ISPs terminated on my firewall and <a href="http://www.example.com">www.example.com</a> with private IP 172.16.3.10 is natted with 1.2.3.4 and 5.6.7.8 with TTL value 300<br></div>Nagios plugin check_tcp would monitor those links or IPs on port 80 and if any of the link fails I can have by any mean edit the zone file and remove the IP associated with failed link so that traffic would never reach to that IP.<br>
<br></div>Upon recovery the plugin will show the result GREEN and I can again have the A record added in zone file, thus reload the zone. Due to the low TTL I believe there shouldn't be any issue for populating those changes faster.  <br>
<br></div>What say guys?<br><br><br></div><br></div><div class="gmail_extra"><br clear="all"><div>--------------------------------------------------------------------------<br>Thanks and Regards,<br>Manish R<br></div>
<br><br><div class="gmail_quote">On Tue, Jul 23, 2013 at 11:46 AM, Mark Andrews <span dir="ltr"><<a href="mailto:marka@isc.org" target="_blank">marka@isc.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
In message <<a href="mailto:CAN3um4yrT%2Bt7Cp2EZYWq-rM5eWx3-ygOK9VKxVUG4qbxcbpzcA@mail.gmail.com">CAN3um4yrT+t7Cp2EZYWq-rM5eWx3-ygOK9VKxVUG4qbxcbpzcA@mail.gmail.com</a>><br>
<div class="im">, Mike Hale writes:<br>
> This seems pretty straight forward.<br>
><br>
> Use your standard bash tools to modify the file when necessary, then<br>
> you should simply be able to call rndc reload ZONENAME in the script.<br>
<br>
</div>Though why one would want to do this rather than just updating the<br>
zone using DDNS is beyond me.   It's not like DDNS can't be made<br>
secure by using TSIG.<br>
<br>
Normalize the zone file using named-checkzone.<br>
Use awk or similar to change the relevent entries and update the SOA serial.<br>
Use named-checkzone to confirm that the resulting file is still valid then<br>
if it is rename it and reload the zone.<br>
<br>
named-checkzone -D -q zone file |<br>
awk '$1 == "server" && $4 == "A" { print $1, $2, $3, $4, NEWIP}<br>
$4 == "SOA" { $7 = $7 + 1; print }' > temp<br>
named-checkzone -q zone temp && mv temp file && rndc reload zone<br>
<br>
Mark<br>
<div class="HOEnZb"><div class="h5"><br>
> On Mon, Jul 22, 2013 at 10:28 PM, Mihamina Rakotomandimby<br>
> <<a href="mailto:mihamina@rktmb.org">mihamina@rktmb.org</a>> wrote:<br>
> > Hello,<br>
> ><br>
> > I did not catch what you're trying to achieve.<br>
> > Please give more details.<br>
> ><br>
> ><br>
> > On 2013-07-23 08:25, Manish Rane wrote:<br>
> ><br>
> > Hi Folks,<br>
> ><br>
> > Wondering if I can edit/change the static zone file as a result of certain<br>
> > bash script. Well, I am trying to write a script which will monitor the<br>
> > server on certain ports and it if fails to connect to the server it will<br>
> > delete or add the entry from zone file so that traffic will be routed to<br>
> > another server, possible?<br>
> ><br>
> > OR does any one aware of such solution available in open source?<br>
> ><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > Please visit <a href="https://lists.isc.org/mailman/listinfo/bind-users" target="_blank">https://lists.isc.org/mailman/listinfo/bind-users</a> to<br>
> > unsubscribe from this list<br>
> ><br>
> > bind-users mailing list<br>
> > <a href="mailto:bind-users@lists.isc.org">bind-users@lists.isc.org</a><br>
> > <a href="https://lists.isc.org/mailman/listinfo/bind-users" target="_blank">https://lists.isc.org/mailman/listinfo/bind-users</a><br>
> ><br>
> ><br>
> ><br>
> > --<br>
> > RMA.<br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > Please visit <a href="https://lists.isc.org/mailman/listinfo/bind-users" target="_blank">https://lists.isc.org/mailman/listinfo/bind-users</a> to<br>
> > unsubscribe from this list<br>
> ><br>
> > bind-users mailing list<br>
> > <a href="mailto:bind-users@lists.isc.org">bind-users@lists.isc.org</a><br>
> > <a href="https://lists.isc.org/mailman/listinfo/bind-users" target="_blank">https://lists.isc.org/mailman/listinfo/bind-users</a><br>
><br>
><br>
><br>
> --<br>
> 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0<br>
> _______________________________________________<br>
> Please visit <a href="https://lists.isc.org/mailman/listinfo/bind-users" target="_blank">https://lists.isc.org/mailman/listinfo/bind-users</a> to unsubscribe<br>
>  from this list<br>
><br>
> bind-users mailing list<br>
> <a href="mailto:bind-users@lists.isc.org">bind-users@lists.isc.org</a><br>
> <a href="https://lists.isc.org/mailman/listinfo/bind-users" target="_blank">https://lists.isc.org/mailman/listinfo/bind-users</a><br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Mark Andrews, ISC<br>
1 Seymour St., Dundas Valley, NSW 2117, Australia<br>
PHONE: +61 2 9871 4742                 INTERNET: <a href="mailto:marka@isc.org">marka@isc.org</a><br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Please visit <a href="https://lists.isc.org/mailman/listinfo/bind-users" target="_blank">https://lists.isc.org/mailman/listinfo/bind-users</a> to unsubscribe from this list<br>
<br>
bind-users mailing list<br>
<a href="mailto:bind-users@lists.isc.org">bind-users@lists.isc.org</a><br>
<a href="https://lists.isc.org/mailman/listinfo/bind-users" target="_blank">https://lists.isc.org/mailman/listinfo/bind-users</a><br>
</div></div></blockquote></div><br></div>