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.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/cmd/resolver/main.go b/cmd/resolver/main.go
index f2d4baf..a3ecbe5 100644
--- a/cmd/resolver/main.go
+++ b/cmd/resolver/main.go
@@ -15,6 +15,7 @@ import (
// List of valid commands.
const (
+ cmdBlockd = "block.d"
cmdCaches = "caches"
cmdEnv = "env"
cmdQuery = "query"
@@ -58,6 +59,26 @@ func main() {
rsol.cmd = strings.ToLower(args[0])
switch rsol.cmd {
+ case cmdBlockd:
+ args = args[1:]
+ if len(args) == 0 {
+ log.Fatalf("resolver: %s: missing sub command", cmdBlockd)
+ }
+
+ subCmd = strings.ToLower(args[0])
+
+ switch subCmd {
+ case subCmdUpdate:
+ args = args[1:]
+ if len(args) == 0 {
+ log.Fatalf("resolver: %s %s: missing argument", rsol.cmd, subCmd)
+ }
+ err = rsol.blockdUpdate(args[0])
+ if err != nil {
+ log.Fatalf("resolver: %s %s: %s", rsol.cmd, subCmd, err)
+ }
+ }
+
case cmdCaches:
args = args[1:]
if len(args) == 0 {
@@ -178,6 +199,13 @@ query <domain / ip-address> [type] [class]
Valid class are either IN, CS, HS.
Default value is IN.
+block.d update <name>
+
+ Fetch the latest hosts file from remote block.d URL defined by
+ its name.
+ On success, the hosts file will be updated and the server will be
+ restarted.
+
caches
Fetch and print all caches from rescached server.