Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Install Bind9 FQDN DNS Server for Local cache Dns Server
- apt-get -y install bind9 dnsutils
- /etc/init.d/bind9 stop
- Konfigurasi Bind Server
- Penambahan zone domain – untuk mengecek domain server bisa gunakan hostname -d
- 1. Edit /etc/bind/named.conf.local
- cp /etc/bind/named.conf.local /etc/bind/named.conf.local_; rm /etc/bind/named.conf.local
- touch /etc/bind/named.conf.local
- nano /etc/bind/named.conf.local
- paste konfigurasi ini dengan sebelumnya mengganti hade.war.net dengan output dari command hostname -d
- zone "hade.war.net" {
- type master;
- file "/etc/bind/db.hade.war.net";
- };
- zone "3.168.192.in-addr.arpa" {
- type master;
- file "/etc/bind/3.168.192.in-addr.arpa.rev";
- };
- include "/etc/bind/zones.rfc1918";
- logging {
- category lame-servers {null; };
- category edns-disabled { null; };
- };
- Save file. Exit.
- 2. Edit /etc/bind/zones.rfc1918 untuk menghapus blok ip yang kita gunakan sebagai ip private
- nano /etc/bind/zones.rfc1918
- karena saya hanya menggunakan blok ip 192.168.0.0/16 maka yang saya delete adalah line ini :
- zone "168.192.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
- 3. penambahan Dns resolver . Untuk Raptor Cache karena menggunakan google public dns maka konfigurasinya seperti di bawah :
- nano /etc/bind/named.conf.options
- options {
- directory "/var/cache/bind";
- // Transmit requests to 192.168.3.1 if
- // this server doesn't know how to resolve them
- forward only;
- forwarders { 8.8.8.8; 8.8.4.4; };
- auth-nxdomain no; # conform to RFC1035
- // max-cache-size
- max-cache-size 30M;
- listen-on-v6 { any; };
- listen-on { 127.0.0.1; 192.168.3.1; };
- // Do not transfer the zone information to the secondary DNS
- allow-transfer { none; };
- // Do not make public version of BIND
- version none;
- };
- Save file. Exit.
- 4. Edit resolv.conf
- di ubuntu 12.04 ke atas yang terinstall paket resolvconf secara default ,
- ada 2 cara yaitu
- 1. bila ip server diset DHCP edit /etc/resolvconf/resolv.conf.d/head dengan menambah line ini
- search hade.war.net
- nameserver 127.0.0.1
- nameserver 8.8.8.8
- nameserver 8.8.4.4
- dan mendelete line ini di /etc/network/interfaces
- dns-nameservers IP_SERVER
- dns-search hade.war.net
- 2. bila anda menggunakan setting static ip bisa dengan hanya mengedit bagian /etc/network/interfaces
- dns-nameservers IP_SERVER
- dns-search hade.war.net
- diubah
- dns-nameservers 127.0.0.1
- dns-nameservers 8.8.8.8
- dns-nameservers 8.8.4.4
- dns-search hade.war.net
- 5. bagian zone.
- nano /etc/bind/db.hade.war.net
- ; BIND data file for hade.war.net
- ;
- $TTL 3h
- @ IN SOA ns1.hade.war.net. [email protected]. (
- 1 ; Serial
- 3h ; Refresh after 3 hours
- 1h ; Retry after 1 hour
- 1w ; Expire after 1 week
- 1h ) ; Negative caching TTL of 1 day
- ;
- @ IN NS ns1.hade.war.net.
- hade.war.net. IN MX 10 mail.hade.war.net.
- hade.war.net. IN A 192.168.3.2
- ns1 IN A 192.168.3.2
- ns2 IN A 192.168.3.1
- www IN CNAME hade.war.net.
- mail IN A 192.168.3.2
- ftp IN CNAME hade.war.net.
- ; EOF
- nano /etc/bind/3.168.192.in-addr.arpa.rev
- ; BIND reverse data file for 3.168.192.in-addr.arpa
- ;
- $TTL 604800
- 3.168.192.in-addr.arpa. IN SOA ns1.hade.war.net. [email protected]. (
- 1 ; Serial
- 3h ; Refresh after 3 hours
- 1h ; Retry after 1 hour
- 1w ; Expire after 1 week
- 1h ) ; Negative caching TTL of 1 day
- ;
- 3.168.192.in-addr.arpa. IN NS ns1.hade.war.net.
- 3.168.192.in-addr.arpa. IN NS ns2.hade.war.net.
- 2.3.168.192.in-addr.arpa. IN PTR hade.war.net.
- ; EOF
- Untuk mengetahui apakah terdapat error di konfigurasi bisa kita coba dengan debug bind
- /usr/sbin/named -g
- Perbaikan error
- - general: error: managed-keys-zone ./IN: loading from master file managed-keys.bind failed: file not found
- touch /var/cache/bind/managed-keys.bind
- chown bind:bind /var/cache/bind/managed-keys.bind
- Perbaikan error
- - none:0: open: /etc/bind/rndc.key: permission denied
- Tambahkan baris ini di /etc/bind/named.conf
- include "/etc/bind/rndc.key";
- chown root:bind /etc/bind/rndc.key
- chmod 640 /etc/bind/rndc.key
- Error port 953 tambahkan
- - masih di file named.conf :
- controls {
- inet 127.0.0.1 port 953
- allow { 127.0.0.1; } keys { "rndc-key"; };
- };
- create /etc/bind/rndc.conf
- -rndc.conf :
- options {
- default-key "rndc-key";
- default-server 127.0.0.1;
- default-port 953;
- };
- If it still doesn't work, maybe you could re-create your key with rndc-confgen.
- http://www.linuxquestions.org/questions/linux-networking-3/dns-rndc-service-errror-229950/
- rndc-confgen > /etc/bind/rndc.conf
- this generated a rndc.conf
- -------------------------------------------
- # Start of rndc.conf
- key "rndc-key" {
- algorithm hmac-md5;
- secret "B2/eIUdqZzQxLES2EcnYBA==";
- };
- options {
- default-key "rndc-key";
- default-server 127.0.0.1;
- default-port 953;
- };
- # End of rndc.conf
- # Use with the following in named.conf, adjusting the allow list as needed:
- # key "rndc-key" {
- # algorithm hmac-md5;
- # secret "B2/eIUdqZzQxLES2EcnYBA==";
- # };
- #
- # controls {
- # inet 127.0.0.1 port 953
- # allow { 127.0.0.1; } keys { "rndc-key"; };
- # };
- # End of named.conf
- ----------------------------------------------------------------------------------
- # rndc status
- Let’s restart Bind to activate our latest changes.
- /etc/init.d/bind9 restart
- Finally, let’s test our new domain and DNS entries.
- Tuning Up
- # ulimit -HSn 65536
- echo 65536 > /proc/sys/fs/file-max
- echo "* soft nofile 65536" >> /etc/security/limits.conf
- echo "* hard nofile 65536" >> /etc/security/limits.conf
- echo "root soft nofile 65536" >> /etc/security/limits.conf
- echo "root hard nofile 65536" >> /etc/security/limits.conf
- echo "proxy soft nofile 65536" >> /etc/security/limits.conf
- echo "proxy hard nofile 65536" >> /etc/security/limits.conf
- tune2fs -m 1.0 /dev/sda5
- tune2fs -m 1.0 /dev/sda6
- tune2fs -m 1.0 /dev/sda7
- If you need to know your drives labels type the following:
- df -T | awk '{print $1,$2,$NF}' | grep "^/dev"
- tune2fs -o journal_data_writeback /dev/sda5
- tune2fs -o journal_data_writeback /dev/sda6
- tune2fs -o journal_data_writeback /dev/sda7
- nano /etc/fstab
- /cache-1 ext4 noatime,barrier=0,nodiratime,relatime,errors=remount-ro,data=writeback 0 0
- /cache-2 ext4 noatime,barrier=0,nodiratime,relatime,errors=remount-ro,data=writeback 0 0
- /cache-3 ext4 noatime,barrier=0,nodiratime,relatime,errors=remount-ro,data=writeback 0 0
- nano /etc/sysctl.p
- edit dengan menghilangkan #
- net.ipv4.conf.default.rp_filter=1
- net.ipv4.conf.all.rp_filter=1
- net.ipv4.tcp_syncookies=1
- net.ipv4.ip_forward=1
- sysctl -w net.netfilter.nf_conntrack_udp_timeout=10
- apt-get -y install webmin squid squid-cgi squid-common squidclient calamaris
- chown -R proxy.proxy /cache-1
- chown -R proxy.proxy /cache-2
- chown -R proxy.proxy /cache-3
- http://pastebin.com/vSnX8gQa
- /etc/init.d/squid stop
- squid -f /etc/squid/squid.conf -z && /etc/init.d/squid start
- iptables -F
- iptables -X
- iptables -t nat -F
- iptables -t nat -X
- iptables -t mangle -F
- iptables -t mangle -X
- iptables -P INPUT ACCEPT
- iptables -P OUTPUT ACCEPT
- iptables -A INPUT -s 192.168.1.0/24 -m state --state NEW -p tcp --dport 53 -j ACCEPT
- iptables -A INPUT -s 192.168.1.0/24 -m state --state NEW -p udp --dport 53 -j ACCEPT
- iptables -A INPUT -p tcp -s 192.168.1.0/24 --dport 80 -j ACCEPT
- iptables -A INPUT -p tcp -s 192.168.1.0/24 --dport 3228 -j ACCEPT
- iptables -t nat -A PREROUTING -p tcp -s 192.168.1.0/24 -d –dport 80 -j REDIRECT –to-port 3228
- iptables-save
- " NOTE : for LUSCA
- apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y && apt-get -y install squid squidclient squid-cgi gcc build-essential sharutils ccze libzip-dev automake1.9
- cd ../home
- wget http://proxy-ku.googlecode.com/files/LUSCA_FMI.tar.gz && tar -xzvf LUSCA_FMI.tar.gz && cd LUSCA_FMI/ && make distclean
- ./configure --prefix=/usr --exec_prefix=/usr --bindir=/usr/sbin --sbindir=/usr/sbin --libexecdir=/usr/lib/squid --sysconfdir=/etc/squid --localstatedir=/var/spool/squid --datadir=/usr/share/squid --enable-http-gzip --enable-async-io=24 --with-aufs-threads=24 --with-pthreads --enable-storeio=aufs --enable-linux-netfilter --enable-arp-acl --enable-epoll --enable-removal-policies=heap --with-aio --with-dl --enable-snmp --enable-delay-pools --enable-htcp --enable-cache-digests --disable-unlinkd --enable-large-cache-files --with-large-files --enable-err-languages=English --enable-default-err-language=English --with-maxfd=65536
- make
- make install
- http://www.indowebster.com/download/files/squid_lusca_fmi
- chmod +x /etc/init.d/squid && /etc/init.d/squid stop
- chown proxy:proxy /cache && chmod 777 /cache chown proxy:proxy /etc/squid/storeurl.pl && chmod 777 /etc/squid/storeurl.pl && chmod +x /etc/init.d/squid
- /etc/init.d/squid stop
- squid -f /etc/squid/squid.conf -z && /etc/init.d/squid restart
- apt-get install acpid
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement