Shell script-automatic DNS deployment and shell script dns

Source: Internet
Author: User

Shell script-automatic DNS deployment and shell script dns

For details, see:

(1) Play with me the Linux Network Service: DNS service -- BIND (/etc/named. conf,/var/named) setting implementation and Explanation

 

 1 #! /bin/bash 2 IP="10.10.10" 3 RIP="10.10.10" 4 DN="gr.org" 5 Name="10.10.10.10" 6  7 cat >> /etc/named.conf << +END+ 8 zone "$DN." IN { 9         type master;10         file "gr.org.db";11 };12 zone "$RIP.in-addr.arpa" IN{13         type master;14         file "$IP.db";15 };16 +END+17 cat > /var/named/$DN.db <<+END+18 \$TTL 8640019 @    IN  SOA    ns.$DN.  root.$DN. (20        20150317  6H  30M  1W  15M)21      IN  NS     ns.$DN.22      IN  MX  10   mail.$DN.23 bbs  IN  CNAME  www.$DN.24 ns   IN  A      $IP.1025 www  IN  A      $IP.1026 mail IN  A      $IP.1127 +END+28 cat > /var/named/$IP.db <<+END+29 \$TTL 8640030 @       IN      SOA     ns.$DN.       root.$DN.(31                 20150317  6H  30M  1W  15M)32         IN      NS      ns.$DN.33 10      IN      PTR     ns.$DN.34 10      IN      PTR     www.$DN.35 11      IN      PTR     mail.$DN.36 +END+37 cat > /etc/resolv.conf <<+END+38 nameserver $Name39 +END+40 41 service named start

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.