Difference between revisions of "BIND: Menambahkan Record"

From OnnoWiki
Jump to navigation Jump to search
(New page: Primary Master Server configuration In this section BIND9 will be configured as the primary master for the domain example.com. Simply replace example.com with your fully qualified domain ...)
 
Line 1: Line 1:
Primary Master Server configuration
+
Konfigurasi Server Primary Master
  
In this section BIND9 will be configured as the primary master for the domain example.com. Simply replace example.com with your fully qualified domain name.
+
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
 
  
To add a DNS zone to BIND9, turning BIND9 into a Primary Master server, all you have to do is edit named.conf.local:
+
==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" {
+
zone "example.com" {
              type master;
+
      type master;
              file "/etc/bind/db.example.com";
+
      file "/etc/bind/db.example.com";
        };
+
};
 
   
 
   
        [...]
+
[...]
  
Now use an existing zone file as a template:
+
Gunakan zone file yang ada sebagai templaye, misalnya:
  
 
  sudo cp /etc/bind/db.local /etc/bind/db.example.com
 
  sudo cp /etc/bind/db.local /etc/bind/db.example.com

Revision as of 16:37, 30 June 2015

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";
};

[...]

Gunakan zone file yang ada sebagai templaye, misalnya:

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

Edit the new zone file /etc/bind/db.example.com change localhost. to the FQDN of your server, 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)

Once you've made a change to the zone file BIND9 will need to be restarted for the changes to take effect:

sudo /etc/init.d/bind9 restart


Referensi