From dbdd005d17808f057e9a92f34d3e21266c9c5bcc Mon Sep 17 00:00:00 2001 From: Lajos Koszti Date: Wed, 12 May 2021 14:46:56 +0200 Subject: [PATCH] Improve readme Fix outdated informations, typos --- README.md | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 2c8a533..c20edb2 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,12 @@ Providers must be listed in a file, one line should be one provider. Empty lines are ignored. Lines started with `#` are ignored. -The file name must be passed with the `-p` parameter to the command. +The file name must be passed with the `-p` parameter to the command or `-` for standard input. ## Addresses IP addresses or domain names which needs to be tested against the providers. -The addresses must be passed with the `-i` parameter to the command. Multipla address can be listed, separate them by comma (`,`). +The addresses must be passed with the `-i` parameter to the command. Multiple address can be listed, separate them by comma (`,`). ## Build @@ -23,10 +23,20 @@ go build ## Execute +Variations for the same operation: + ```sh ./dnsbl-check -i 1.2.3.4 -p providers ``` +```sh +./dnsbl-check -i 1.2.3.4 -p - < providers +``` + +``` +cat providers | ./dnsbl-check -i 1.2.3.4 -p - +``` + ## Output The program returns every result in a new line, fields are separated by TAB character `\t`. @@ -37,7 +47,7 @@ The line starts with the status: `OK` or `FAIL` or `ERR` - `ERR` returned if the address lookup failed Second field is the address Third field is the provider -Fourth field is filled only if the statis is either `FAIL` or `ERR`. If the status is `FAIL` and no reason returned from te provider, the `unknown reason` text will be shown. If the status is `ERR` the error message will be shown here. +Fourth field is filled only if the status is either `FAIL` or `ERR`. If the status is `FAIL` and no reason returned from te provider, the `unknown reason` text will be shown. If the status is `ERR` the error message will be shown here. ``` OK 127.0.0.2 dyn.rbl.polspam.pl @@ -49,7 +59,7 @@ ERR 127.0.0.2 spam.dnsbl.anonmails.de lookup 2.0.0.127.spam.dnsbl.anonmails.de o List of providers coming from http://multirbl.valli.org/list/ -To get ipv4 blacklist providers run the following command: +To get IPv4 blacklist providers run the following command: ```sh awk '$5 == "b" && $2 == "ipv4" && $1 != "(hidden)" { print $1 }' < providers > ipv4providers @@ -58,7 +68,7 @@ awk '$5 == "b" && $2 == "ipv4" && $1 != "(hidden)" { print $1 }' < providers > i Then you can test if a provider is working - responds to a test query: ```sh -./dnsbl-check -p ipv4providers -i 127.0.0.2 | awk '$1 == "ERR" { print $3 }' > ipv4verified +./dnsbl-check -p ipv4providers -i 127.0.0.2 | awk '$1 == "FAIL" { print $3 }' > ipv4verified ``` Then with that list you can check if your IP address is blacklisted: @@ -70,8 +80,8 @@ Then with that list you can check if your IP address is blacklisted: It can be piped into one command: ```sh awk '$5 == "b" && $2 == "ipv4" && $1 != "(hidden)" { print $1 }' < providers | \ -./dnsbl-check -p ipv4providers -i 127.0.0.2 | awk '$1 == "ERR" { print $3 }' | \ -./dnsbl-check -p ip4verified -i 1.2.3.4 +./dnsbl-check -p - -i 127.0.0.2 | awk '$1 == "FAIL" { print $3 }' | \ +./dnsbl-check -p - -i 1.2.3.4 ``` -However it's recommended to keep the used provider list separetly, to save the resources of the providers. +However it's recommended to keep the used provider list separately, to save the resources of the providers.