############################################################################### # checklocaldomains, a script for Cpanel servers # Checks that local domains are really local and warns owners # (and optionally users) if they aren't. # First public release: 08/JAN/2005 # (c) Juan R. Pozo - jrpozo@conclase.net - http://html.conclase.net/cp/scripts/ ############################################################################### ############################################################################### # Copyright (c) 2005, Juan R. Pozo # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # - The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. ############################################################################### ############################################################################### CONFIGURATION SETTINGS: ############################################################################### - $path The absolute path to the script and its configuration files Default value: $path = '/root/scripts/checklocaldomains'; - $debug Debug level. Possible values: 0: no debug 1: simple debug (script progress) 2: verbose debug (dig command results) 3: full debug (outputs warning messages) Default value: $debug = 1; - $rootonly Whether to notify only root user, of notify all owners and optionally users. Possible values: 1: notify root only 0: notify root, resellers and optionally users Default value: $rootonly = 1; ############################################################################### CONFIGURATION FILES ############################################################################### - resolver The list of resolving name servers that the script will use. Place as many *external* resolver as you wish here (one IP address per line). Do not use your own nameservers!! Ask your ISP for at least a couple of resolving name servers you can use. - notify The usernames of the resellers whose users should receive a warning about their domains being not local (one username per line). This list is empty by default, so only owners are notified unless modified. - notify.all If you want to notify all users of all resellers, create a file notify.all in the directory specified by $path above. - ignore A list of domains which are known not to be strictly local but should be in the local domains list. For example, domains of users who insist on using their own nameservers but whose email is handled by your server. - owner.template The template for the email warning sent to the owners. A usable sample is included. - user.template The template for the email warning sent to the users. A usable sample is included. ############################################################################### SETUP ############################################################################### After adding a set of suitable nameservers to the resolver configuration file, I recommend running the script once from command line, with $debug = 1 and $rootonly = 1 to see if everything seems to be fine. You can then set both variables to 0 (if you wish) and add the script to root's crontab. Hope you find the script useful. If you do, please feel free to donate: http://html.conclase.net/cp/scripts or http://html.conclase.net/link/wishlist Thanks! ;) Juan R. Pozo