Skip to content

Commit

Permalink
Improve readme
Browse files Browse the repository at this point in the history
Fix outdated informations, typos
  • Loading branch information
Ajnasz committed May 12, 2021
1 parent 11fe62f commit dbdd005
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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`.
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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.

0 comments on commit dbdd005

Please sign in to comment.