Difference between revisions of "BIND: Memasukan Record"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) (Created page with "==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.example....") |
Onnowpurbo (talk | contribs) |
||
| Line 7: | Line 7: | ||
Di file ini kita bisa tambahkan forward dan revese zone dari sebuah domain, contoh | Di file ini kita bisa tambahkan forward dan revese zone dari sebuah domain, contoh | ||
| − | zone "nyc3. | + | zone "nyc3.contoh.web.id" { |
type master; | type master; | ||
| − | file "/etc/bind/zones/db.nyc3. | + | file "/etc/bind/zones/db.nyc3.contoh.web.id"; # zone file path |
| − | allow-transfer { 10.128.20.12; }; | + | allow-transfer { 10.128.20.12; }; # ns2 private IP address - secondary |
}; | }; | ||
| Line 28: | Line 28: | ||
sudo mkdir /etc/bind/zones | sudo mkdir /etc/bind/zones | ||
cd /etc/bind/zones | cd /etc/bind/zones | ||
| − | sudo cp ../db.local ./db.nyc3. | + | sudo cp ../db.local ./db.nyc3.contoh.web.id |
| − | sudo vi /etc/bind/zones/db.nyc3. | + | sudo vi /etc/bind/zones/db.nyc3.contoh.web.id |
Isi awalnya kira-kira | Isi awalnya kira-kira | ||
| Line 48: | Line 48: | ||
$TTL 604800 | $TTL 604800 | ||
| − | @ IN SOA ns1.nyc3. | + | @ IN SOA ns1.nyc3.contoh.web.id. admin.nyc3.contoh.web.id. ( |
3 ; Serial | 3 ; Serial | ||
604800 ; Refresh | 604800 ; Refresh | ||
| Line 56: | Line 56: | ||
; | ; | ||
; name servers - NS records | ; name servers - NS records | ||
| − | IN NS ns1.nyc3. | + | IN NS ns1.nyc3.contoh.web.id. |
| − | IN NS ns2.nyc3. | + | IN NS ns2.nyc3.contoh.web.id. |
; name servers - A records | ; name servers - A records | ||
| − | ns1.nyc3. | + | ns1.nyc3.contoh.web.id. IN A 10.128.10.11 |
| − | ns2.nyc3. | + | ns2.nyc3.contoh.web.id. IN A 10.128.20.12 |
; 10.128.0.0/16 - A records | ; 10.128.0.0/16 - A records | ||
| − | host1.nyc3. | + | host1.nyc3.contoh.web.id. IN A 10.128.100.101 |
| − | host2.nyc3. | + | host2.nyc3.contoh.web.id. IN A 10.128.200.102 |
==Buat Reverse Zone File== | ==Buat Reverse Zone File== | ||
| Line 91: | Line 91: | ||
$TTL 604800 | $TTL 604800 | ||
| − | @ IN SOA nyc3. | + | @ IN SOA nyc3.contoh.web.id. admin.nyc3.contoh.web.id. ( |
3 ; Serial | 3 ; Serial | ||
604800 ; Refresh | 604800 ; Refresh | ||
| Line 98: | Line 98: | ||
604800 ) ; Negative Cache TTL | 604800 ) ; Negative Cache TTL | ||
; name servers | ; name servers | ||
| − | IN NS ns1.nyc3. | + | IN NS ns1.nyc3.contoh.web.id. |
| − | IN NS ns2.nyc3. | + | IN NS ns2.nyc3.contoh.web.id. |
; PTR Records | ; PTR Records | ||
| − | 11.10 IN PTR ns1.nyc3. | + | 11.10 IN PTR ns1.nyc3.contoh.web.id. ; 10.128.10.11 |
| − | 12.20 IN PTR ns2.nyc3. | + | 12.20 IN PTR ns2.nyc3.contoh.web.id. ; 10.128.20.12 |
| − | 101.100 IN PTR host1.nyc3. | + | 101.100 IN PTR host1.nyc3.contoh.web.id. ; 10.128.100.101 |
| − | 102.200 IN PTR host2.nyc3. | + | 102.200 IN PTR host2.nyc3.contoh.web.id. ; 10.128.200.102 |
==Cek Syntax Konfigurasi BIND== | ==Cek Syntax Konfigurasi BIND== | ||
| Line 115: | Line 115: | ||
Cek zone tertentu | Cek zone tertentu | ||
| − | sudo named-checkzone nyc3. | + | 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 | sudo named-checkzone 128.10.in-addr.arpa /etc/bind/zones/db.10.128 | ||
Revision as of 12:25, 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; }; # ns2 private IP address - secondary
};
Asumsi private 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; }; # 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
Buat Reverse Zone File
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