Semua parameter agent json sama dengan parameter LIBKNOT
perhatikan json berikut ini :
{
"command-set": {
"sendblock": {
"cmd": "conf-set",
"zone": "lagi2.id",
"item": "notify",
"owner": "",
"rtype": "",
"ttl": "",
"flags": "",
"section":"zone",
"data": "slave"
},
"receive": {
"type": "block"
}
}
}
cmd aksi untuk setting (dibagi 2 yaitu knot configuration and zone configuration)
conf-read
conf-begin
conf-set
conf-unset
conf-commit
zone configuration :
zone-read
zone-begin
zone-set
zone-unset
section target configuration knot
1. template
2. zone
3. log
4. remote
5. acl
6. mod-stats
7. server
8. log
item untuk setting item configuration knot
untuk pengisian knotc configuration reference /etc/knot/knot.conf
example:
- domain: example.net
master: master
acl: acl_master
domain, master, acl adalah item
zone memilih zone target
contoh pada saat melakukan configuration zone maka zone ini berisi target zone tersebut
data value dari setting knot
data adalah isi dari seluruh configuration misal untuk setting notify pada zone configuration
maka hal yang perlu dilakukan adalah mengatur item ke notify
selanjutnya set data menjadi target notify
- domain: example.net
master: master
acl: acl_master
domain, master, acl adalah item
example.net, master, acl adalah data
owner adalah pemilik zone config ketika proses penambahan record configuration
rtype hanya berlaku record configuration
ttl hanya berlaku record configuration
flags parameter ini masih siluman sampai sekarang saya belum dapat fungsinya
identifier parameter ini masih siluman sampai sekarang saya belum dapat fungsinya
adalah proses penambahan domain menjadi satu kedalam knot config
adalah proses penambahan record kedalam zone configuration
adalah baris perintah yang dilakukan setiap melakukan aksi configuration pada knot config
adalah baris perintah yang di lakukan untuk menyimpan seluruh aksi
adalah baris perintah untuk melakukan configuration pada knot
CONTOH ZONE CONFIGURATION KNOT (PERHATIKAN POLA COMMAND LINE MEMAKAI KNOTC DENGAN PARAMETER LIBKNOT):
knotc conf-begin
{
"command-set": {
"sendblock": {
"cmd": "conf-begin"
},
"receive": {
"type": "block"
}
}
}
knotc conf-commit
{
"command-set": {
"sendblock": {
"cmd": "conf-commit"
},
"receive": {
"type": "block"
}
}
}
{
"command-set": {
"sendblock": {
"cmd": "conf-read"
},
"receive": {
"type": "block"
}
}
}
knotc conf-set 'zone[nama_domain.com]'
{
"command-set": {
"sendblock": {
"cmd": "conf-set",
"item": "domain",
"section":"zone",
"data": "nama_domain.com"
},
"receive": {
"type": "block"
}
}
}
knotc conf-set 'zone[nama_domain.com].notify' 'slave1' 'slave2'
{
"command-set": {
"sendblock": {
"cmd": "conf-set",
"zone": "nama_domain.com",
"item": "notify",
"owner": "",
"rtype": "",
"ttl": "",
"flags": "",
"section":"zone",
"data": "slave salve2"
},
"receive": {
"type": "block"
}
}
}
knotc conf-set 'zone[nama_domain.com].file' 'nama_domain.com.zone'
{
"command-set": {
"sendblock": {
"cmd": "conf-set",
"zone": "nama_domain.com",
"item": "file",
"owner": "",
"rtype": "",
"ttl": "",
"flags": "",
"section":"zone",
"data": "nama_domain.com.zone" # atau nama file backup zone tersebut
},
"receive": {
"type": "block"
}
}
}
knotc conf-set 'zone[nama_domain.com].master' 'master1' 'master2'
{
"command-set": {
"sendblock": {
"cmd": "conf-set",
"zone": "nama_domain.com",
"item": "master",
"owner": "",
"rtype": "",
"ttl": "",
"flags": "",
"section":"zone",
"data": "master master2"
},
"receive": {
"type": "block"
}
}
}
knotc conf-set 'zone[nama_domain.com].acl' 'slave1_acl' 'slave2_acl'
{
"command-set": {
"sendblock": {
"cmd": "conf-set",
"zone": "nama_domain.com",
"item": "acl",
"owner": "",
"rtype": "",
"ttl": "",
"flags": "",
"section":"zone",
"data": "slave1_acl slave2_acl"
},
"receive": {
"type": "block"
}
}
}
knotc conf-set 'zone[nama_domain.com].module' 'mod-stats/default'
{
"command-set": {
"sendblock": {
"cmd": "conf-set",
"zone": "nama_domain.com",
"item": "module",
"owner": "",
"rtype": "",
"ttl": "",
"flags": "",
"section":"zone",
"data": "mod-stats/default"
},
"receive": {
"type": "block"
}
}
}
knotc zone-begin nama_domain.com
"zone-command": {
"sendblock": {
"cmd": "zone-begin",
"zone": "nama_domain.com"
},
"receive": {
"type": "block"
}
}
knotc zone-commit 'nama_domain.com'
"zone-command": {
"sendblock": {
"cmd": "zone-commit",
"zone": "nama_domain.com"
},
"receive": {
"type": "block"
}
}
knotc zone-read 'nama_domain.com'
"zone-command": {
"sendblock": {
"cmd": "zone-read",
"zone": "" # isi untuk zone yang lebih spesifik
},
"receive": {
"type": "block"
}
}
knotc zone-set nama_domain.com. record_name.nama_domain.com. 7200 A 127.0.0.1
{
"zone-command": {
"sendblock": {
"cmd": "zone-set",
"zone": "nama_domain.com",
"owner": "record_name",
"rtype": "A",
"ttl": "7200",
"data": "127.0.0.1"
},
"receive": {
"type": "block"
}
}
}
knotc zone-set nama_domain.com. @ 86400 SOA satu.neodns.id. hostmaster.neodns.id. 2018070410 10800 3600 604800 38400
{
"zone-command": {
"sendblock": {
"cmd": "zone-set",
"zone": "nama_domain.com",
"owner": "@",
"rtype": "SOA",
"ttl": "7200",
"data": "satu.neodns.id. hostmaster.neodns.id. 2018070410 10800 3600 604800 38400"
},
"receive": {
"type": "block"
}
}
}
knotc zone-set nama_domain.com. record_name.nama_domain.com. 7200 NS satu.neodns.id
{
"zone-command": {
"sendblock": {
"cmd": "zone-set",
"zone": "nama_domain.com",
"owner": "record_name",
"rtype": "NS",
"ttl": "7200",
"data": "satu.neodns.id."
},
"receive": {
"type": "block"
}
}
}
knotc zone-set nama_domain.com. record_name.nama_domain.com. 7200 MX 0 mail.neodns.id.
{
"zone-command": {
"sendblock": {
"cmd": "zone-set",
"zone": "nama_domain.com",
"owner": "record_name",
"rtype": "MX",
"ttl": "7200",
"data": "0 mail.neodns.id."
},
"receive": {
"type": "block"
}
}
}