Difference between revisions of "PowerDNS: Instalasi di Ubuntu"
Onnowpurbo (talk | contribs)  | 
				Onnowpurbo (talk | contribs)   | 
				||
| Line 210: | Line 210: | ||
  ;; global options: +cmd  |   ;; global options: +cmd  | ||
  ;; Got answer:  |   ;; Got answer:  | ||
| − |   ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id:   | + |   ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16025  | 
  ;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1  |   ;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1  | ||
| − |   ;; WARNING: recursion requested but not available  | + |   ;; WARNING: recursion requested but not available    | 
  ;; OPT PSEUDOSECTION:  |   ;; OPT PSEUDOSECTION:  | ||
  ; EDNS: version: 0, flags:; udp: 2800  |   ; EDNS: version: 0, flags:; udp: 2800  | ||
  ;; QUESTION SECTION:  |   ;; QUESTION SECTION:  | ||
| − |   ;.   | + |   ;.				IN	NS  | 
  ;; Query time: 4 msec  |   ;; Query time: 4 msec  | ||
  ;; SERVER: 127.0.0.1#53(127.0.0.1)  |   ;; SERVER: 127.0.0.1#53(127.0.0.1)  | ||
| − |   ;; WHEN: Mon   | + |   ;; WHEN: Mon Jun 01 09:00:26 WIB 2015  | 
  ;; MSG SIZE  rcvd: 29  |   ;; MSG SIZE  rcvd: 29  | ||
Or,  | Or,  | ||
| − |   sudo dig @192.168.  | + |   sudo dig @192.168.0.100  | 
| − | + | Dimana, 192.168.0.100 adalah IP address dari PowerDNS server  | |
| − | + | Contoh output:  | |
| − |   ; <<>> DiG 9.9.5-3-Ubuntu <<>> @192.168.  | + |   ; <<>> DiG 9.9.5-3-Ubuntu <<>> @192.168.0.100  | 
  ; (1 server found)  |   ; (1 server found)  | ||
  ;; global options: +cmd  |   ;; global options: +cmd  | ||
  ;; Got answer:  |   ;; Got answer:  | ||
| − |   ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id:   | + |   ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7241  | 
  ;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1  |   ;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1  | ||
  ;; WARNING: recursion requested but not available  |   ;; WARNING: recursion requested but not available  | ||
| Line 243: | Line 243: | ||
  ; EDNS: version: 0, flags:; udp: 2800  |   ; EDNS: version: 0, flags:; udp: 2800  | ||
  ;; QUESTION SECTION:  |   ;; QUESTION SECTION:  | ||
| − |   ;.   | + |   ;.				IN	NS  | 
| − |   ;; Query time:   | + |   ;; Query time: 4 msec  | 
| − |   ;; SERVER: 192.168.  | + |   ;; SERVER: 192.168.0.100#53(192.168.0.100)  | 
| − |   ;; WHEN: Mon   | + |   ;; WHEN: Mon Jun 01 09:01:43 WIB 2015  | 
  ;; MSG SIZE  rcvd: 29  |   ;; MSG SIZE  rcvd: 29  | ||
| − | + | Selesai sudah. PowerDNS siap digunakan.  | |
| − | |||
| − | |||
==Referensi==  | ==Referensi==  | ||
* http://www.unixmen.com/how-to-install-powerdns-on-ubuntu-14-04/  | * http://www.unixmen.com/how-to-install-powerdns-on-ubuntu-14-04/  | ||
Revision as of 09:02, 1 June 2015
Install PowerDNS di Ubuntu
Operating system: Ubuntu 14.04 LTS server IP Address: 192.168.0.100/24 Hostname: refserver
Update apps
sudo apt-get update sudo apt-get upgrade -y
Instalasi & Setup MySQL
sudo apt-get install mysql-server mysql-client
Jika sedang belajar dapat menggunakan password root 123456. Untuk operasional sebaiknya jangan menggunakan password root 123456.
Edit /etc/mysql/my.cnf agar MySQL mendengarkan semua interfaces.
sudo vi /etc/mysql/my.cnf
Cari kalimat berikut, dan di beri pagar (#).
[...] #bind-address = 127.0.0.1 [...]
Simpan dan tutup file. Restart MySQL service.
sudo service mysql restart
Selesai sudah proses instalasi MySQL. Selanjutnya kita akan menginstalasi PowerDNS.
Install PowerDNS
Instalasi
sudo apt-get install pdns-server pdns-backend-mysql
Lakukan:
- Tekan 'Yes' untuk Configure database for pdns-backend-mysql with dbconfig-common?
 - Masukan password root MySQL (dalam contoh ini 123456).
 - Masukan password untuk pdns-backend-mysql untuk register ke database server. Untuk memudahkan gunakan password 123456
 - Ulangi masukan password untuk pdns-backend-mysql untuk register ke database server.
 
Sekarang PowerDNS sudah di instalasi.
Create PowerDNS Database dan User di MySQL
Masuk ke MySQL
sudo mysql -u root -p
untuk password root 123456 dapat menggunakan
sudo mysql -u root -p123456
Buat database ‘powerdns’. Database user 'poweruser'. Atau kita dapat membuat sendiri juga
CREATE DATABASE powerdns; GRANT ALL ON powerdns.* TO 'poweruser '@'localhost' IDENTIFIED BY 'ubuntu';
Disini,
- powerdns – adalah database;
 - poweruser – adalah database user,
 - ubuntu – adalah password for the ‘poweruser’ user.
 
Sebaiknya menggunakan password yang lebih baik agar security lebih aman.
Tulis perintah berikut untuk update user settings.
FLUSH PRIVILEGES;
Gunakan powerdns database, menggunakan perintah:
USE powerdns;
Buat tabel dan record.
Buat tabel domains:
CREATE TABLE domains ( id INT auto_increment, name VARCHAR(255) NOT NULL, master VARCHAR(128) DEFAULT NULL, last_check INT DEFAULT NULL, type VARCHAR(6) NOT NULL, notified_serial INT DEFAULT NULL, account VARCHAR(40) DEFAULT NULL, primary key (id) ); CREATE UNIQUE INDEX name_index ON domains(name);
Buat tabel records:
CREATE TABLE records ( id INT auto_increment, domain_id INT DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, type VARCHAR(6) DEFAULT NULL, content VARCHAR(255) DEFAULT NULL, ttl INT DEFAULT NULL, prio INT DEFAULT NULL, change_date INT DEFAULT NULL, primary key(id) );
CREATE INDEX rec_name_index ON records(name); CREATE INDEX nametype_index ON records(name,type); CREATE INDEX domain_id ON records(domain_id);
Buat tabel supermasters:
CREATE TABLE supermasters ( ip VARCHAR(25) NOT NULL, nameserver VARCHAR(255) NOT NULL, account VARCHAR(40) DEFAULT NULL );
Keluar dari MySQL menggunakan perintah:
quit;
Konfigurasi PowerDNS
Konfigurasi PowerDNS untuk menggunakan MySQL sebagai backend untuk menyimpan file Zone dan records.
Buang file konfigurasi PowerDNS yang ada.
sudo rm /etc/powerdns/pdns.d/*.*
Buat file /etc/powerdns/pdns.d/pdns.local.gmysql.conf ;
sudo vi /etc/powerdns/pdns.d/pdns.local.gmysql.conf
Tambahkan kalimat berikut, yang sesuai dengan konfigurasi yang kita lakukan sebelumnya:
# MySQL Configuration # # Launch gmysql backend launch=gmysql # gmysql parameters gmysql-host=localhost gmysql-dbname=powerdns gmysql-user=poweruser gmysql-password=ubuntu
Restart powerdns service.
sudo service pdns restart
Test PowerDNS
Edit file /ect/resolv.conf ,
sudo vi /etc/resolv.conf
isi
nameserver 192.168.0.100
sesuai dengan IP address server
Set the name server IP address:
auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet static address 192.168.0.100 netmask 255.255.255.0 network 192.168.0.0 broadcast 192.168.0.255 gateway 192.168.0.223 dns-nameservers 192.168.0.223 dns-search home
Kita selesai dengan semua bagian instalasi dan konfigurasi. Selanjutnya, kita perlu cek apakah PowerDNS dapat berjalan dengan baik atau tidak.
Pertama-tama, cek apakah PowerDNS mendengarkan:
sudo netstat -tap | grep pdns
contoh output:
tcp 0 0 *:domain *:* LISTEN 4845/pdns_server-in
Sekarang, masukan perintah berikut, untuk mencek apakah PowerDNS berjalan dengan baik:
sudo dig @127.0.0.1
atau,
sudo dig @localhost
Contoh output:
; <<>> DiG 9.9.5-3-Ubuntu <<>> @127.0.0.1 ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16025 ;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1 ;; WARNING: recursion requested but not available ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 2800 ;; QUESTION SECTION: ;. IN NS ;; Query time: 4 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Mon Jun 01 09:00:26 WIB 2015 ;; MSG SIZE rcvd: 29
Or,
sudo dig @192.168.0.100
Dimana, 192.168.0.100 adalah IP address dari PowerDNS server
Contoh output:
; <<>> DiG 9.9.5-3-Ubuntu <<>> @192.168.0.100 ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7241 ;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1 ;; WARNING: recursion requested but not available ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 2800 ;; QUESTION SECTION: ;. IN NS ;; Query time: 4 msec ;; SERVER: 192.168.0.100#53(192.168.0.100) ;; WHEN: Mon Jun 01 09:01:43 WIB 2015 ;; MSG SIZE rcvd: 29
Selesai sudah. PowerDNS siap digunakan.