budiana

MASTER SQUID DAN BIND9

Mar 5th, 2021 (edited)
1,118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.32 KB | None | 0 0
  1. nano /etc/ssh/sshd_config [enter]
  2. # edit PermitRootLogin without-password to
  3. PermitRootLogin yes
  4.  
  5. apt-get update [enter]  
  6. service ssh restart
  7.  
  8. apt-get install devscripts build-essential openssl libssl-dev fakeroot libcppunit-dev libsasl2-dev cdbs ccze libfile-readbackwards-perl libcap2 libcap-dev libcap2-dev -y [enter]  
  9.  
  10. apt-get install sysv-rc-conf -y [enter]  
  11.  
  12. # Install aplikasi DNS server bind9. 192.168.2.222 adalah ip server yang menuju client.
  13.  
  14. apt install bind9 dnsutils
  15.  
  16. # Masuk ke direktori konfigurasi bind dan buka file konfigurasi named.conf.options.
  17.  
  18. cd /etc/bind
  19.  
  20. nano named.conf.options
  21. # Tambah dan ubah menjadi seperti di bawah ini.
  22.  
  23. listen-on-v6 { none; };
  24. listen-on port 53 { localhost; 192.168.2.0/24; };
  25. allow-query { localhost; 192.168.2.0/24; };
  26. forwarders { 8.8.8.8; 8.8.4.4; 1.1.1.1; };
  27. recursion yes;  
  28.  
  29. # Buka file konfigurasi named.conf.local.
  30.  
  31. nano named.conf.local
  32.  
  33. # Tambahkan di baris paling bawah.
  34.  
  35. zone "proxy.local.net" {
  36.   type master;
  37.     file "/etc/bind/forward.proxy.local.net";
  38. };
  39.  
  40. zone "2.168.192.in-addr.arpa" {
  41.   type master;
  42.     file "/etc/bind/reverse.proxy.local.net";
  43. };  
  44.  
  45.  
  46. # Selanjutnya membuat file konfigurasi forward.proxy.local.net.
  47.  
  48. cp db.local forward.proxy.local.net
  49. nano forward.proxy.local.net  
  50.  
  51. # Ubah isinya menjadi seperti di bawah ini.
  52.  
  53. ;
  54. ; BIND data file for local loopback interface
  55. ;
  56. $TTL    604800
  57. @       IN      SOA     proxy.local.net. root.proxy.local.net. (
  58.                               2         ; Serial
  59.                          604800         ; Refresh
  60.                           86400         ; Retry
  61.                         2419200         ; Expire
  62.                          604800 )       ; Negative Cache TTL
  63. ;
  64.  
  65. @       IN      NS      ns1.proxy.local.net.
  66. @       IN      NS      ns2.proxy.local.net.
  67. @       IN      A       192.168.2.222
  68. ns1     IN      A       192.168.2.222
  69. ns2     IN      A       192.168.2.222
  70. www     IN      CNAME   proxy.local.net.
  71. Selanjutnya file konfigurasi reverse.proxy.local.net.
  72.  
  73. cp db.127 reverse.proxy.local.net
  74. nano reverse.proxy.local.net  
  75.  
  76.  
  77. Ubah menjadi seperti di bawah ini.
  78.  
  79.  
  80. ;
  81. ; BIND reverse data file for local loopback interface
  82. ;
  83. $TTL    604800
  84. @       IN      SOA     proxy.local.net. root.proxy.local.net. (
  85.                               1         ; Serial
  86.                          604800         ; Refresh
  87.                           86400         ; Retry
  88.                         2419200         ; Expire
  89.                          604800 )       ; Negative Cache TTL
  90. ;
  91.  
  92.         IN      NS      ns1.proxy.local.net.
  93.         IN      NS      ns2.proxy.local.net.
  94. ns1     IN      A       192.168.2.222
  95. ns2     IN      A       192.168.2.222
  96. @       IN      A       192.168.2.222
  97. 1       IN      PTR     proxy.local.net.
  98. Restart service bind9, cek statusnya beserta file konfigurasi named.conf.
  99.  
  100. systemctl restart bind9
  101. systemctl status bind9
  102. named-checkconf
  103.  
  104. Tambahkan nama domain dan IP address server pada file konfigurasi DNS resolver. File ini sebelumnya sudah diisi dengan IP address dari DNS server Google dan Cloudflare.
  105.  
  106. nano /etc/resolv.conf
  107.  
  108. Isinya menjadi.
  109.  
  110. search proxy.local.net
  111. nameserver 192.168.2.222
  112. nameserver 8.8.4.4
  113. nameserver 8.8.8.8
  114. nameserver 1.1.1.1  
  115.  
  116. Uji konfigurasi DNS server dengan menjalankan perintah nslookup atau dig.
  117.  
  118.  
Add Comment
Please, Sign In to add comment