ispman/lib dns.bind8.lib,1.21,1.22

Joerg Delker <[email protected]>
Newsgroups gmane.comp.isp.ispman.cvs
Message-ID <[email protected]>
Update of /cvsroot/ispman/ispman/lib
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv4346/lib

Modified Files:
	dns.bind8.lib 
Log Message:
preventing dangling catchAllCNAME

Index: dns.bind8.lib
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/dns.bind8.lib,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- dns.bind8.lib	7 Jun 2005 20:36:22 -0000	1.21
+++ dns.bind8.lib	6 Jun 2006 11:08:34 -0000	1.22
@@ -256,10 +256,13 @@
         if (   $ispman->getConf('catchAllCNAME')
             && $ispman->getConf('catchAllCNAME') ne "none" )
         {
-            print ZONE join( "\t",
-                ( "*", "\t", "IN", "CNAME", $ispman->getConf('catchAllCNAME') )
-              ),
-              "\n";
+            # check if CNAME is pointing to an A record
+            my $arec = $ispman->getConf('catchAllCNAME');
+            if (! $ispman->isArecord($arec,$domain)) {
+                logsay("WARNING! CatchAllCNAME \"$arec\" has no matching A-record!");
+                print ZONE "; WARNING!!! Deactivated catchAllCNAME, because A-record doesn't exist!\n; ";            
+            }
+            print ZONE join( "\t", ( "*", "\t", "IN", "CNAME", $ispman->getConf('catchAllCNAME') )), "\n";
         }
 
 # look if there is a local file where more entries for this zone are  defined.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.