henrydenhengst

Ubuntu 14.04 DNS Primary Master with Caching Nameserver

Nov 25th, 2014
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.71 KB | None | 0 0
  1. #!/bin/bash
  2. #title           :install-dns-on-ubuntu1404.sh
  3. #description     :This script will install dns on ubuntu 14.04
  4. #author          :Henry den Hengst
  5. #date            :25 November 2014
  6. #version         :0.1    
  7. #usage           :bash install-dns-on-ubuntu1404.sh
  8. #URL             :-
  9. #user_password   :-
  10. #notes           :-
  11. #bash_version    :-
  12. #credits_source  :https://help.ubuntu.com/
  13. #
  14. sudo apt-get update && sudo apt-get upgrade -y
  15. sudo apt-get install bind9 dnsutils openssh-server ntp -y
  16. # Edit /etc/network/interfaces to meet your requirements.
  17. #
  18. sudo sed -i 's!dhcp!static!g' /etc/network/interfaces
  19. sudo sed -i '$ a\address 192.168.1.10' /etc/network/interfaces
  20. sudo sed -i '$ a\netmask 255.255.255.0' /etc/network/interfaces
  21. sudo sed -i '$ a\network 192.168.1.0' /etc/network/interfaces
  22. sudo sed -i '$ a\broadcast 192.168.1.255' /etc/network/interfaces
  23. sudo sed -i '$ a\gateway 192.168.1.1' /etc/network/interfaces
  24. #
  25. sudo sed -i '$ a\dns-nameservers 192.168.1.10 192.168.1.11 8.8.8.8 8.8.4.4' /etc/network/interfaces
  26. sudo sed -i '$ a\dns-search cloudconsult.local' /etc/network/interfaces
  27. sudo sed -i '$ a\dns-domain cloudconsult.local' /etc/network/interfaces
  28. #
  29. # restart network
  30. sudo service networking restart
  31. #
  32. cd /etc/bind/
  33. # sudo rm named.conf.options
  34. # sudo wget -c https://dl.dropboxusercontent.com/u/36257811/bind9/named.conf.options
  35. sudo rm named.conf.local
  36. sudo wget -c https://dl.dropboxusercontent.com/u/36257811/bind9/named.conf.local
  37. sudo wget -c https://dl.dropboxusercontent.com/u/36257811/bind9/db.cloudconsult.local
  38. sudo wget -c https://dl.dropboxusercontent.com/u/36257811/bind9/db.192
  39. sudo service bind9 restart
  40. sudo ufw enable
  41. sudo ufw allow OpenSSH
  42. sudo ufw allow Bind9
Advertisement
Add Comment
Please, Sign In to add comment