Difference between revisions of "BIND: Memasukan Record"

From OnnoWiki
Jump to navigation Jump to search
Line 124: Line 124:
 
  101.100 IN      PTR    host1.nyc3.contoh.web.id.  ; 10.128.100.101
 
  101.100 IN      PTR    host1.nyc3.contoh.web.id.  ; 10.128.100.101
 
  102.200 IN      PTR    host2.nyc3.contoh.web.id.  ; 10.128.200.102
 
  102.200 IN      PTR    host2.nyc3.contoh.web.id.  ; 10.128.200.102
 +
 +
 +
 +
==Buat Reverse Zone IPv6==
 +
 +
Buat dan edit
 +
 +
    cd /etc/bind/zones
 +
    sudo cp ../db.127 ./db.5.4.3.2
 +
    sudo vi /etc/bind/zones/db.5.4.3.2
 +
 +
Awalnya akan berisi kira-kira
 +
 +
$TTL    604800
 +
@      IN      SOA    localhost. root.localhost. (
 +
                              1        ; Serial
 +
                          604800        ; Refresh
 +
                          86400        ; Retry
 +
                        2419200        ; Expire
 +
                          604800 )      ; Negative Cache TTL
 +
;
 +
@      IN      NS      localhost.      ; delete this line
 +
1.0.0  IN      PTR    localhost.      ; delete this line
 +
 +
Ubah menjadi kira-kira,
 +
  
  
Line 148: Line 174:
 
   
 
   
 
  ; IPv6 PTR entries
 
  ; IPv6 PTR entries
  1.0.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.5.4.3.2.ip6.arpa.   IN    PTR    host1.nyc3.contoh.web.id.
+
  1.0.1    IN    PTR    host1.nyc3.contoh.web.id.
  2.0.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.5.4.3.2.ip6.arpa.   IN    PTR    host2.nyc3.contoh.web.id.
+
  2.0.1    IN    PTR    host2.nyc3.contoh.web.id.
  
 
==Buat Reverse Zone IPv6==
 
==Buat Reverse Zone IPv6==

Revision as of 14:41, 20 February 2019

Konfigurasi Local File

Edit

sudo vi /etc/bind/named.conf.local

Di file ini kita bisa tambahkan forward dan revese zone dari sebuah domain, contoh

zone "nyc3.contoh.web.id" {
    type master;
    file "/etc/bind/zones/db.nyc3.contoh.web.id"; # zone file path
    allow-transfer {
        10.128.20.12;
        2345::2;
        };             # ns2 private IP address - secondary
};

Asumsi subnet 10.128.0.0/16, reverse zone- adalah,

zone "128.10.in-addr.arpa" {
    type master;
    file "/etc/bind/zones/db.10.128";  # 10.128.0.0/16 subnet
    allow-transfer {
        10.128.20.12;
        2345::2;
        };  # ns2 private IP address - secondary
};

Asumsi subnet 2345::/64, reverse zone- adalah,

zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.5.4.3.2.ip6.arpa." {
    type master;
    file "/etc/bind/zones/db.5.4.3.2";  # 2345::/64 subnet
    allow-transfer {
        10.128.20.12;
        2345::2;
        };  # ns2 private IP address - secondary
};

Buat Forward Zone File

Buat dan edit

sudo mkdir /etc/bind/zones
cd /etc/bind/zones
sudo cp ../db.local ./db.nyc3.contoh.web.id
sudo vi /etc/bind/zones/db.nyc3.contoh.web.id

Isi awalnya kira-kira

$TTL    604800
@       IN      SOA     localhost. root.localhost. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      localhost.      ; delete this line
@       IN      A       127.0.0.1       ; delete this line
@       IN      AAAA    ::1             ; delete this line

Dapat kita ubah menjadi, misalnya,

$TTL    604800
@       IN      SOA     ns1.nyc3.contoh.web.id. admin.nyc3.contoh.web.id. (
                  3       ; Serial
             604800     ; Refresh
              86400     ; Retry
            2419200     ; Expire
             604800 )   ; Negative Cache TTL
;
; name servers - NS records
     IN      NS      ns1.nyc3.contoh.web.id.
     IN      NS      ns2.nyc3.contoh.web.id. 

; name servers - A records
ns1.nyc3.contoh.web.id.          IN      A       10.128.10.11
ns2.nyc3.contoh.web.id.          IN      A       10.128.20.12

; 10.128.0.0/16 - A records
host1.nyc3.contoh.web.id.        IN      A      10.128.100.101
host2.nyc3.contoh.web.id.        IN      A      10.128.200.102
host1.nyc3.contoh.web.id.        IN      AAAA   2345::101
host2.nyc3.contoh.web.id.        IN      AAAA   2345::102

Buat Reverse Zone File

Buat dan edit

   cd /etc/bind/zones
   sudo cp ../db.127 ./db.5.4.3.2
   sudo vi /etc/bind/zones/db.5.4.3.2

Awalnya akan berisi kira-kira

$TTL    604800
@       IN      SOA     localhost. root.localhost. (
                              1         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      localhost.      ; delete this line
1.0.0   IN      PTR     localhost.      ; delete this line

Ubah menjadi kira-kira,

$TTL    604800
@       IN      SOA     nyc3.contoh.web.id. admin.nyc3.contoh.web.id. (
                              3         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
; name servers
      IN      NS      ns1.nyc3.contoh.web.id.
      IN      NS      ns2.nyc3.contoh.web.id.

; PTR Records
11.10   IN      PTR     ns1.nyc3.contoh.web.id.    ; 10.128.10.11
12.20   IN      PTR     ns2.nyc3.contoh.web.id.    ; 10.128.20.12
101.100 IN      PTR     host1.nyc3.contoh.web.id.  ; 10.128.100.101
102.200 IN      PTR     host2.nyc3.contoh.web.id.  ; 10.128.200.102


Buat Reverse Zone IPv6

Buat dan edit

   cd /etc/bind/zones
   sudo cp ../db.127 ./db.5.4.3.2
   sudo vi /etc/bind/zones/db.5.4.3.2

Awalnya akan berisi kira-kira

$TTL    604800
@       IN      SOA     localhost. root.localhost. (
                              1         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      localhost.      ; delete this line
1.0.0   IN      PTR     localhost.      ; delete this line

Ubah menjadi kira-kira,


;
; 2345::1/64
;
; Zone file built with the IPv6 Reverse DNS zone builder
; http://rdns6.com/
;
$TTL 1h	; Default TTL
@	IN	SOA	nyc3.contoh.web.id.	admin.nyc3.contoh.web.id. (
	2019022001	; serial
	1h		; slave refresh interval
	15m		; slave retry interval
	1w		; slave copy expire time
	1h		; NXDOMAIN cache time
	)

;
; domain name servers
;
@	IN	NS	ns1.nyc3.contoh.web.id.
@	IN	NS	ns2.nyc3.contoh.web.id.

; IPv6 PTR entries
1.0.1    IN    PTR    host1.nyc3.contoh.web.id.
2.0.1    IN    PTR    host2.nyc3.contoh.web.id.

Buat Reverse Zone IPv6

Buat dan edit

   cd /etc/bind/zones
   sudo cp ../db.127 ./db.10.128
   sudo vi /etc/bind/zones/db.10.128

Awalnya akan berisi kira-kira

$TTL    604800
@       IN      SOA     localhost. root.localhost. (
                              1         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      localhost.      ; delete this line
1.0.0   IN      PTR     localhost.      ; delete this line

Ubah menjadi kira-kira,

$TTL    604800
@       IN      SOA     nyc3.contoh.web.id. admin.nyc3.contoh.web.id. (
                              3         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
; name servers
      IN      NS      ns1.nyc3.contoh.web.id.
      IN      NS      ns2.nyc3.contoh.web.id.

; PTR Records
11.10   IN      PTR     ns1.nyc3.contoh.web.id.    ; 10.128.10.11
12.20   IN      PTR     ns2.nyc3.contoh.web.id.    ; 10.128.20.12
101.100 IN      PTR     host1.nyc3.contoh.web.id.  ; 10.128.100.101
102.200 IN      PTR     host2.nyc3.contoh.web.id.  ; 10.128.200.102

Cek Syntax Konfigurasi BIND

Jalankan perintah

sudo named-checkconf

Cek zone tertentu

sudo named-checkzone nyc3.contoh.web.id db.nyc3.contoh.web.id
sudo named-checkzone 128.10.in-addr.arpa /etc/bind/zones/db.10.128

Pastikan tidak ada error

Restart BIND

Restart

   sudo service bind9 restart


Pranala Menarik