{"id":13581656,"url":"https://github.com/Ajnasz/dnsbl-check","last_synced_at":"2025-04-06T10:32:41.637Z","repository":{"id":59043224,"uuid":"364161643","full_name":"Ajnasz/dnsbl-check","owner":"Ajnasz","description":"Checks if the given IP address(es) are listed at the given dnsrbl provider(s).","archived":false,"fork":false,"pushed_at":"2022-08-19T08:32:31.000Z","size":57,"stargazers_count":20,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-24T16:41:12.595Z","etag":null,"topics":["dnsbl","dnsbl-checker","dnsbl-lookups","dnsbl-rejections","email-blacklist","mx","spam"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ajnasz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-04T06:32:21.000Z","updated_at":"2024-04-10T19:31:19.000Z","dependencies_parsed_at":"2022-09-11T04:41:25.759Z","dependency_job_id":null,"html_url":"https://github.com/Ajnasz/dnsbl-check","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ajnasz%2Fdnsbl-check","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ajnasz%2Fdnsbl-check/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ajnasz%2Fdnsbl-check/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ajnasz%2Fdnsbl-check/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ajnasz","download_url":"https://codeload.github.com/Ajnasz/dnsbl-check/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247470395,"owners_count":20944146,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dnsbl","dnsbl-checker","dnsbl-lookups","dnsbl-rejections","email-blacklist","mx","spam"],"created_at":"2024-08-01T15:02:09.536Z","updated_at":"2025-04-06T10:32:40.904Z","avatar_url":"https://github.com/Ajnasz.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# DNSBL Check\n\nChecks if the given IP address(es) are listed at the given dnsrbl provider(s).\n\nDNSRBL lists are used to fight against e-mail spams. They detect and list IP addresses that are used to send unwanted e-mails. When an e-mail sent from a blacklisted address, the anti-spam software will mark the message as Spam.\n\nThis software is useful for sysadmins who operates MTA (Mail Transfer Agent) softwares and want to see if their IP address they use to send e-mail is listed on an RBL list - therefore they can see a reason why some clients doesn't receive e-mail.\n\n## Providers\n\nProviders must be listed in a file, one line should be one provider.\nEmpty lines are ignored.\nLines started with `#` are ignored.\n\nThe file name must be passed with the `-p` parameter to the command or `-` for standard input.\n\n## Addresses\n\nIP addresses or domain names which needs to be tested against the providers.\nThe addresses must be passed with the `-i` parameter to the command. Multiple address can be listed, separate them by comma (`,`).\n\n## Build\n\n```sh\ngo build\n```\n\n## Execute\n\nTest if the IP address `1.2.3.4` is blacklisted in providers listed in `providers` file (see [how to get provider list](#getting-provider-list) section):\n\nVariations for the same operation:\n\n```sh\n./dnsbl-check -i 1.2.3.4 -p ipv4providers\n```\n\n```sh\n./dnsbl-check -i 1.2.3.4 -p - \u003c ipv4providers\n```\n\n```sh\ncat ipv4providers | ./dnsbl-check -i 1.2.3.4 -p -\n```\n\n## Output\n\nThe program returns every result in a new line, fields are separated by TAB character `\\t`.\n\nThe line starts with the status: `OK` or `FAIL` or `ERR`\n\n- `OK` returned if no listing found for the address\n- `FAIL` returned if listing found for the address\n- `ERR` returned if the address lookup failed\n\nSecond field is the address\nThird field is the provider\nFourth 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.\n\n```text\nOK\t127.0.0.2\tdyn.rbl.polspam.pl\nFAIL\t127.0.0.2\tbl.spamcop.net\tBlocked - see https://www.spamcop.net/bl.shtml?127.0.0.2\nERR\t127.0.0.2\tspam.dnsbl.anonmails.de\tlookup 2.0.0.127.spam.dnsbl.anonmails.de on 127.0.0.53:53: server misbehaving\n```\n\n## Getting provider list\n\nList of providers coming from [http://multirbl.valli.org/list/](http://multirbl.valli.org/list/)\n\n### IPv4 providers\n\nTo get ipv4 blacklist providers run the following command:\n\n```sh\nawk '$5 == \"b\" \u0026\u0026 $2 == \"ipv4\" \u0026\u0026 $1 != \"(hidden)\" { print $1 }' \u003c providers \u003e ipv4providers\n```\n\nThen you can test if a provider is working - responds to a test query (query the address [127.0.0.2](https://datatracker.ietf.org/doc/html/rfc5782#section-5)):\n\n```sh\n./dnsbl-check -p ipv4providers -i 127.0.0.2 | awk '$1 == \"FAIL\" { print $3 }' \u003e ipv4verified\n```\n\nThen with that list you can check if your IP address (1.2.3.4) is blacklisted:\n\n```sh\n./dnsbl-check -p ip4verified -i 1.2.3.4\n```\n\nIt can be piped into one command:\n\n```sh\nawk '$5 == \"b\" \u0026\u0026 $2 == \"ipv4\" \u0026\u0026 $1 != \"(hidden)\" { print $1 }' \u003c providers | \\\n./dnsbl-check -p - -i 127.0.0.2 | awk '$1 == \"FAIL\" { print $3 }' | \\\n./dnsbl-check -p - -i 1.2.3.4\n```\n\nHowever it's recommended to keep the used provider list separately, to save the resources of the providers.\n\n### Domain providers\n\nSimilar to the IPv4 providers, but we filter the multirbl list to items which are maintaining balck lists of domains:\n\n```sh\nawk '$5 == \"b\" \u0026\u0026 $4 == \"dom\" \u0026\u0026 $1 != \"(hidden)\" { print $1 }' \u003c providers \u003e domain_providers\n```\n\nThen check if the provider is looking good query the address [TEST](https://datatracker.ietf.org/doc/html/rfc5782#section-5)\n\n```sh\n./dnsbl-check -p domain_providers -i TEST | awk '$1 == \"FAIL\" { print$3 }' \u003e domain_providers_verified\n```\n\nYou can check the address `INVALID` as well, which should return `OK`:\n\n```sh\n./dnsbl-check -p domain_providers -i TEST | awk '$1 == \"FAIL\" { print $3 }' | \\\n./dnsbl-check -p - -i INVALID  | awk '$1 == \"OK\" { print $3 }' \u003e domain_providers_verified\n\n```\n\nThen you can query your domain:\n\n```sh\n./dnsbl-check -p domain_providers_verified -i mail.example.com\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAjnasz%2Fdnsbl-check","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAjnasz%2Fdnsbl-check","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAjnasz%2Fdnsbl-check/lists"}