BIND: Menambahkan Record

From OnnoWiki
Jump to navigation Jump to search

Konfigurasi Server Primary Master

Pada bagian ini BIND9 akan dikonfigurasi sebagai primary master untuk domain example.com. Kita dapat dengan mudah mengubah example.com dengan domain yang kita inginkan.


Zone File

Untuk menambahkan DNS zone ke BIND9, dan membuat BIND9 menjadi server Primary Master, yang kita perlu lakukan adalah mengedit named.conf.local:

[...]

zone "example.com" {
     type master;
     file "/etc/bind/db.example.com";
};

[...]

Buat Record File

Gunakan zone file yang ada sebagai template, misalnya:

sudo cp /etc/bind/db.local /etc/bind/db.example.com

Edit zone file yang baru /etc/bind/db.example.com ubah localhost. ke FQDN dari server anda, leaving the additional "." at the end. Change 127.0.0.1 to the nameserver's IP Address and root.localhost to a valid email address, but with a "." instead of the "@". also leaving the "." at the end.

Also, create an A record for ns.example.com the name server in this example:

;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     ns.example.com. root.example.com. (
                              1         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      ns.example.com.
ns      IN      A       192.168.1.10

;also list other computers
box     IN      A       192.168.1.21

You must increment the serial number every time you make changes to the zone file. If you make multiple changes before restarting BIND9, simply increment the serial once.

Now, you can add DNS records to the bottom of the zone.

Tip: Many people like to use the last date edited as the serial of a zone, such as 2005010100 which is yyyymmddss (where s is serial)

Setelah kita selesai melakukan perubahan zone file, BIND9 perlu di restart agar perubahan tersebut berlaku:

sudo /etc/init.d/bind9 restart

Referensi