From bb08b5bb6ad6cf3e1c409db7d69ace4364e7bc8d Mon Sep 17 00:00:00 2001
From: Shulhan <ms@kilabit.info>
Date: Tue, 17 May 2022 23:39:10 +0700
Subject: cmd/resolver: implement command to delete record on zone

Given the following command

  $ resolver zone.d rr delete <zone> <"@" | subdomain> <type> <class> <value>

It will delete the record in zone by given subdomain, type, class, and
value.
---
 _doc/resolver.adoc | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

(limited to '_doc/resolver.adoc')

diff --git a/_doc/resolver.adoc b/_doc/resolver.adoc
index 362bc62..d2d96c5 100644
--- a/_doc/resolver.adoc
+++ b/_doc/resolver.adoc
@@ -245,6 +245,13 @@ we pass two parameters:
 See the example below for more information.
 --
 
+`zone.d rr delete <zone> <"@" | subdomain> <type> <class> <value>`::
++
+--
+Delete record from zone by its subdomain, type, class, and value.
+--
+
+
 == EXIT STATUS
 
 Upon exit and success +resolver+ will return 0, or 1 otherwise.
@@ -394,6 +401,10 @@ Get all records in the zone "my.zone",
 Add IPv4 address "127.0.0.1" for domain my.zone,
 
 	$ resolver zone.d rr add my.zone @ 0 A IN 127.0.0.1
+
+or
+
+	$ resolver zone.d rr add my.zone "" 0 A IN 127.0.0.1
 	{
 	  "Value": "127.0.0.1",
 	  "Name": "my.zone",
@@ -402,6 +413,11 @@ Add IPv4 address "127.0.0.1" for domain my.zone,
 	  "TTL": 604800
 	}
 
+and to delete the above record,
+
+	$ resolver zone.d rr delete my.zone @ A IN 127.0.0.1
+	OK
+
 Add subdomain "www" with IPv4 address "192.168.1.2" to zone "my.zone",
 
 	$ resolver zone.d rr add my.zone www 0 A IN 192.168.1.2
@@ -413,6 +429,10 @@ Add subdomain "www" with IPv4 address "192.168.1.2" to zone "my.zone",
 	  "TTL": 604800
 	}
 
+and to delete the above record,
+
+	$ resolver zone.d rr delete my.zone www A IN 192.168.1.2
+	OK
 
 == AUTHOR
 
-- 
cgit v1.3

