diff options
| author | Shulhan <ms@kilabit.info> | 2022-05-13 21:14:29 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2022-05-13 21:14:29 +0700 |
| commit | 20c3f80e7dfd9e453d757199beb2137c09a9f536 (patch) | |
| tree | 82711df23adee40b578a4da395a9588877132d88 /cmd/resolver/main.go | |
| parent | c9de13ce2432dee7d58fb45c4cecbf026786a48d (diff) | |
| download | rescached-20c3f80e7dfd9e453d757199beb2137c09a9f536.tar.xz | |
cmd/resolver: implement command to delete record on hosts file
The command has the following signature,
resolver hosts.d rr delete <name> <domain>
Given the hosts name "hosts" and domain "my.hosts" it will delete
all records that have domain name "my.hosts" inside the file.
Diffstat (limited to 'cmd/resolver/main.go')
| -rw-r--r-- | cmd/resolver/main.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/cmd/resolver/main.go b/cmd/resolver/main.go index 2c40b90..fac894c 100644 --- a/cmd/resolver/main.go +++ b/cmd/resolver/main.go @@ -206,6 +206,10 @@ hosts.d rr add <name> <domain> <value> If the domain name already exists, the new record will be appended instead of replaced. +hosts.d rr delete <name> <domain> + + Delete record from hosts file "name" by domain name. + == Examples @@ -299,5 +303,16 @@ Add new record "127.0.0.1 my.hosts" to hosts file named "hosts", "Type": 1, "Class": 1, "TTL": 604800 + } + +Delete record "my.hosts" from hosts file "hosts", + + $ resolver hosts.d rr delete hosts my.hosts + { + "Value": "127.0.0.1", + "Name": "my.hosts", + "Type": 1, + "Class": 1, + "TTL": 604800 }`) } |
