Shell指令碼——DNS自動部署

來源:互聯網
上載者:User

標籤:

詳細說明查看:

(一)跟我一起玩Linux網路服務:DNS服務——BIND(/etc/named.conf、/var/named)設定實現和解釋

 

 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

 

Shell指令碼——DNS自動部署

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.