aboutsummaryrefslogtreecommitdiff
path: root/cmd/resolver/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/resolver/main.go')
-rw-r--r--cmd/resolver/main.go36
1 files changed, 33 insertions, 3 deletions
diff --git a/cmd/resolver/main.go b/cmd/resolver/main.go
index a3ecbe5..0678b21 100644
--- a/cmd/resolver/main.go
+++ b/cmd/resolver/main.go
@@ -20,9 +20,11 @@ const (
cmdEnv = "env"
cmdQuery = "query"
- subCmdSearch = "search"
- subCmdRemove = "remove"
- subCmdUpdate = "update"
+ subCmdEnable = "enable"
+ subCmdDisable = "disable"
+ subCmdRemove = "remove"
+ subCmdSearch = "search"
+ subCmdUpdate = "update"
)
func main() {
@@ -68,6 +70,26 @@ func main() {
subCmd = strings.ToLower(args[0])
switch subCmd {
+ case subCmdDisable:
+ args = args[1:]
+ if len(args) == 0 {
+ log.Fatalf("resolver: %s %s: missing argument", rsol.cmd, subCmd)
+ }
+ err = rsol.blockdDisable(args[0])
+ if err != nil {
+ log.Fatalf("resolver: %s %s: %s", rsol.cmd, subCmd, err)
+ }
+
+ case subCmdEnable:
+ args = args[1:]
+ if len(args) == 0 {
+ log.Fatalf("resolver: %s %s: missing argument", rsol.cmd, subCmd)
+ }
+ err = rsol.blockdEnable(args[0])
+ if err != nil {
+ log.Fatalf("resolver: %s %s: %s", rsol.cmd, subCmd, err)
+ }
+
case subCmdUpdate:
args = args[1:]
if len(args) == 0 {
@@ -199,6 +221,14 @@ query <domain / ip-address> [type] [class]
Valid class are either IN, CS, HS.
Default value is IN.
+block.d disable <name>
+
+ Disable specific hosts on block.d.
+
+block.d enable <name>
+
+ Enable specific hosts on block.d.
+
block.d update <name>
Fetch the latest hosts file from remote block.d URL defined by