diff --git a/README.md b/README.md index ab26382..b4db60f 100644 --- a/README.md +++ b/README.md @@ -773,3 +773,161 @@ +----+-----------+------------------------+------+----------------------------------------------------------------+-------+------+----------+-----------+------+-------------+ 6 rows in set (0.00 sec) ``` + +## Konfigurasi Table di PowerDNS Slave + +Langkah pertama tambahkan data berikut pada table supermasters + +> ``` +MariaDB [Slave_pdns]> insert into supermasters values ('103.23.20.70', 'pd2.padiakse.my.id', 'admin'); +MariaDB [Slave_pdns]> select *from supermasters; ++--------------+--------------------+---------+ +| ip | nameserver | account | ++--------------+--------------------+---------+ +| 103.23.20.70 | pd2.padiakse.my.id | admin | ++--------------+--------------------+---------+ +1 rows in set (0.00 sec) +``` + +Langkah ketiga tambahkan kolom change_date pada table records + +> ``` +MariaDB [Slave_pdns]> ALTER TABLE records add change_date INT DEFAULT NULL; +``` + +Berikut kolom dari table records +> ``` +MariaDB [Slave_pdns]> DESC records; ++-------------+----------------+------+-----+---------+----------------+ +| Field | Type | Null | Key | Default | Extra | ++-------------+----------------+------+-----+---------+----------------+ +| id | bigint(20) | NO | PRI | NULL | auto_increment | +| domain_id | int(11) | YES | MUL | NULL | | +| name | varchar(255) | YES | MUL | NULL | | +| type | varchar(10) | YES | | NULL | | +| content | varchar(64000) | YES | | NULL | | +| ttl | int(11) | YES | | NULL | | +| prio | int(11) | YES | | NULL | | +| disabled | tinyint(1) | YES | | 0 | | +| ordername | varchar(255) | YES | MUL | NULL | | +| auth | tinyint(1) | YES | | 1 | | +| change_date | int(11) | YES | | NULL | | ++-------------+----------------+------+-----+---------+----------------+ +11 rows in set (0.01 sec) +``` + +## Testing Replikasi PowerDNS Master Slave +**Testing Konfigurasi dari sisi Master** + +* Restart Service PowerDNS + +> ``` +[root@pdns pdns]# systemctl restart pdns +``` + +* Jalankan perintah berikut untuk memperbarui zona dns master + +> ``` +[root@pdns pdns]# pdnsutil increase-serial padiakse.my.id +SOA serial for zone padiakse.my.id set to 13 +``` + +* Jalankan perintah berikut untuk melakukan notify dan mereplikasi record dns master ke pdns slave. + +> ``` +[root@pdns pdns]# pdns_control notify padiakse.my.id +Added to queue +``` + +* Untuk melihat apakah PowerDNS Master telah terhubung dengan PowerDNS Slave. + +> ``` +[root@pdns pdns]# systemctl stop pdns +``` + +> ``` +[root@pdns pdns]# /usr/sbin/pdns_server --daemon=no --guardian=no --loglevel=9 +Mar 20 08:41:10 Reading random entropy from '/dev/urandom' +Mar 20 08:41:10 Loading '/usr/lib64/pdns/libgmysqlbackend.so' +Mar 20 08:41:10 [gmysqlbackend] This is the gmysql backend version 4.1.11 reporting +Mar 20 08:41:10 This is a standalone pdns +Mar 20 08:41:10 Listening on controlsocket in '/var/run/pdns.controlsocket' +Mar 20 08:41:10 UDP server bound to 0.0.0.0:53 +Mar 20 08:41:10 UDPv6 server bound to [::]:53 +Mar 20 08:41:10 TCP server bound to 0.0.0.0:53 +Mar 20 08:41:10 TCPv6 server bound to [::]:53 +Mar 20 08:41:10 PowerDNS Authoritative Server 4.1.11 (C) 2001-2018 PowerDNS.COM BV +Mar 20 08:41:10 Using 64-bits mode. Built using gcc 4.8.5 20150623 (Red Hat 4.8.5-36). +Mar 20 08:41:10 PowerDNS comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it according to the terms of the GPL version 2. +Mar 20 08:41:10 Set effective group id to 993 +Mar 20 08:41:10 Set effective user id to 996 +Mar 20 08:41:10 Creating backend connection for TCP +Mar 20 08:41:10 gmysql Connection successful. Connected to database 'testpdns' on 'localhost'. +Mar 20 08:41:10 About to create 3 backend threads for UDP +Mar 20 08:41:10 Master/slave communicator launching +Mar 20 08:41:10 gmysql Connection successful. Connected to database 'testpdns' on 'localhost'. +Mar 20 08:41:10 No master domains need notifications +Mar 20 08:41:10 gmysql Connection successful. Connected to database 'testpdns' on 'localhost'. +Mar 20 08:41:10 gmysql Connection successful. Connected to database 'testpdns' on 'localhost'. +Mar 20 08:41:10 gmysql Connection successful. Connected to database 'testpdns' on 'localhost'. +Mar 20 08:41:10 Done launching threads, ready to distribute questions +``` + +**Testing Konfigurasi dari sisi Slave** + +* Untuk melihat apakah PowerDNS Slave telah terhubung dengan PowerDNS Master. + +> ``` +[root@imam pdns]# systemctl stop pdns +``` + +> ``` +[root@imam pdns]# /usr/sbin/pdns_server --daemon=no --guardian=no --loglevel=9 +Mar 20 08:49:30 Reading random entropy from '/dev/urandom' +Mar 20 08:49:30 Loading '/usr/lib64/pdns/libgmysqlbackend.so' +Mar 20 08:49:30 [gmysqlbackend] This is the gmysql backend version 4.1.11 reporting +Mar 20 08:49:30 This is a standalone pdns +Mar 20 08:49:30 Listening on controlsocket in '/var/run/pdns.controlsocket' +Mar 20 08:49:30 UDP server bound to 0.0.0.0:53 +Mar 20 08:49:30 UDPv6 server bound to [::]:53 +Mar 20 08:49:30 TCP server bound to 0.0.0.0:53 +Mar 20 08:49:30 TCPv6 server bound to [::]:53 +Mar 20 08:49:30 PowerDNS Authoritative Server 4.1.11 (C) 2001-2018 PowerDNS.COM BV +Mar 20 08:49:30 Using 64-bits mode. Built using gcc 4.8.5 20150623 (Red Hat 4.8.5-36). +Mar 20 08:49:30 PowerDNS comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it according to the terms of the GPL version 2. +Mar 20 08:49:30 Set effective group id to 993 +Mar 20 08:49:30 Set effective user id to 996 +Mar 20 08:49:30 Creating backend connection for TCP +Mar 20 08:49:30 Master/slave communicator launching +Mar 20 08:49:30 gmysql Connection successful. Connected to database 'Slave_pdns' on 'localhost'. +Mar 20 08:49:30 About to create 3 backend threads for UDP +Mar 20 08:49:30 gmysql Connection successful. Connected to database 'Slave_pdns' on 'localhost'. +Mar 20 08:49:30 No new unfresh slave domains, 0 queued for AXFR already, 0 in progress +Mar 20 08:49:30 gmysql Connection successful. Connected to database 'Slave_pdns' on 'localhost'. +Mar 20 08:49:30 gmysql Connection successful. Connected to database 'Slave_pdns' on 'localhost'. +Mar 20 08:49:30 gmysql Connection successful. Connected to database 'Slave_pdns' on 'localhost'. +Mar 20 08:49:30 Done launching threads, ready to distribute questions +``` + +* Jalankan ulang/Restart service PowerDNS Slave kemudian cek table Records pada database PowerDNS Slave. + +> ``` +[root@imam pdns]# systemctl restart pdns +``` + +> ``` +MariaDB [Slave_pdns]> select *from records; ++-----+-----------+------------------------+------+--------------------------------------------------------------+-------+------+----------+-----------+------+-------------+ +| id | domain_id | name | type | content | ttl | prio | disabled | ordername | auth | change_date | ++-----+-----------+------------------------+------+--------------------------------------------------------------+-------+------+----------+-----------+------+-------------+ +| 98 | 1 | padiakse.my.id | SOA | padiakse.my.id root.padiakse.my.id 13 10380 3600 604800 3600 | 86400 | 0 | 0 | NULL | 1 | NULL | +| 99 | 1 | padiakse.my.id | A | 103.23.20.70 | 3600 | 0 | 0 | NULL | 1 | NULL | +| 100 | 1 | padiakse.my.id | NS | pd1.padiakse.my.id | 86400 | 0 | 0 | NULL | 1 | NULL | +| 101 | 1 | padiakse.my.id | NS | pd2.padiakse.my.id | 86400 | 0 | 0 | NULL | 1 | NULL | +| 102 | 1 | pd1.padiakse.my.id | A | 103.23.20.70 | 3600 | 0 | 0 | NULL | 1 | NULL | +| 104 | 1 | pd2.padiakse.my.id | A | 117.53.47.189 | 3600 | 0 | 0 | NULL | 1 | NULL | ++-----+-----------+------------------------+------+--------------------------------------------------------------+-------+------+----------+-----------+------+-------------+ +6 rows in set (0.00 sec) +``` + +**Uji Coba untuk Menambah Record**