Menü +

find ./ -type f -name '*source-string*'

dns domains generator


#!/bin/bash
BIND_DIR="/etc/bind"
DOMAIN_DIR="/etc/bind/domains/"
NAME_SERVER1="ns1.domain.com"
NAME_SERVER2="ns2.domain.com"
NAME_SERVER3="ns3.domain.com"
SERVER_IP="123.123.123.123"
DOMAINS="
domain1.com
domain2.com
domain3.com
"
for DOMAIN in $DOMAINS; do 
cat << EOF > ${DOMAIN_DIR}${DOMAIN}
;
;
\$ORIGIN ${DOMAIN}.
\$TTL    600s
@               IN      SOA     ${NAME_SERVER1}. postmaster.${DOMAIN}. (
                $(date +%Y%m%d%M)      ; serial
                3h              ; refresh
                1h              ; retry
                1w              ; expire
                1h              ; minimum
                )
; DNS
                IN      NS      ${NAME_SERVER1}.
                IN      NS      ${NAME_SERVER2}.
                IN      NS      ${NAME_SERVER3}.
; MX
                IN      MX      10 aspmx.l.google.com.
                IN      MX      20 alt1.aspmx.l.google.com.
                IN      MX      20 alt2.aspmx.l.google.com.
                IN      MX      30 aspmx2.googlemail.com.
                IN      MX      30 aspmx3.googlemail.com.
                IN      MX      30 aspmx4.googlemail.com.
                IN      MX      30 aspmx5.googlemail.com.
; A   
${DOMAIN}.      IN      A       ${SERVER_IP}            
; Aliases
www.${DOMAIN}.  IN      CNAME   ${DOMAIN}.
*               IN      CNAME   ${NAME_SERVER1}.
; Google App
mail            IN      CNAME   ${DOMAIN}.
webmail         IN      CNAME   ${DOMAIN}.
calendar        IN      CNAME   ${DOMAIN}.
docs            IN      CNAME   ${DOMAIN}.
drive           IN      CNAME   ${DOMAIN}.
groups          IN      CNAME   ${DOMAIN}.
sites           IN      CNAME   ${DOMAIN}.

EOF
done



Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.