So you want to regularly check your IP(s) if they got listed on one of the many (800+ to be exact) public blacklists (also known as DNSBL or RBL)?
Bellow, you can find a bash script that will make your life much easier. You can also make a cronjob that sends you an email with the results or simply display the results with PHP.
#!/bin/sh # Check if an IP address is listed on one of the following blacklists # The format is chosen to make it easy to add or delete # The shell will strip multiple whitespace # Last updated on 20.02.2019 @ slurp-ramen.com BLISTS=" 0outspam.fusionzero.com 0spam.fusionzero.com 0spam-killlist.fusionzero.com 0spamtrust.fusionzero.com 0spamurl.fusionzero.com 3y.spam.mrs.kithrup.com 88.blocklist.zap ab.surbl.org abuse-contacts.abusix.org abuse.rfc-clueless.org abuse.rfc-ignorant.org accept.the-carrot-and-the-stick.com access.atlbl.net access.redhawk.org accredit.habeas.com admin.bl.kundenserver.de adult.rhs.mailpolice.com adv.rhs.mailpolice.com ahbl.dnsbl.net.au ahrh.dnsbl.net.au all.ascc.dnsbl.bit.nl all.dnsbl.bit.nl all.rbl.jp all.rbl.kropka.net all.rbl.webiron.net all.s5h.net all.spamblock.unit.liu.se all.spamrats.com all.spam-rbl.fr all.v6.ascc.dnsbl.bit.nl any.dnsl.ipquery.org apnic-main.bogons.dnsiplists.completewhois.com arin-legacy-classb.bogons.dnsiplists.completewhois.com arin-legacy-classc.bogons.dnsiplists.completewhois.com arin-main.bogons.dnsiplists.completewhois.com arspam.buanzo.org asiaspam.spamblocked.com asn.routeviews.org aspath.routeviews.org aspews.dnsbl.sorbs.net aspews.ext.sorbs.net assholes.madscience.nl auth.spamrats.com autowork.drbl.ks.cz babl.rbl.webiron.net backscat.dnsl.ipquery.org backscatter.rbl.kropka.net backscatter.spameatingmonkey.net badconf.rhsbl.sorbs.net badhost.stopspam.org badnets.spameatingmonkey.net bad.psky.me bad.whois.bl.techtheft.info bandwidth-pigs.monkeys.com ban.zebl.zoneedit.com b.barracudacentral.org bb.barracudacentral.org bbm.2ch.net bbx.2ch.net be.whitelist.skopos.be bhnc.njabl.org bitonly.dnsbl.bit.nl black.dnsbl.securityplanet.nl blackhole.compu.net blackholes.2mbit.com blackholes.alphanet.ch blackholes.brainerd.net blackholes.easynet.nl blackhole.securitysage.com blackholes.five-ten-sg.com blackholes.intersil.net blackholes.mail-abuse.org blackholes.sandes.dk blackholes.scconsult.com blackholes.uceb.org blackholes.wirehub.net black.junkemailfilter.com blacklist.fpsn.net blacklist.hostkarma.com blacklist.informationwave.net blacklist.mail.ops.asp.att.net blacklist.mailrelay.att.net blacklist.netcore.co.in blacklist.sci.kun.nl blacklist.sci.ru.nl blacklist.sequoia.ops.asp.att.net blacklist.spambag.org blacklist.woody.ch black.uribl.com bl.blbl.org bl.blocklist.de bl.blueshore.net bl.borderworlds.dk bl.csma.biz bl.deadbeef.com bl.drmx.org bl.emailbasura.org bl.fmb.la bl.ipv6.spameatingmonkey.net bl.konstant.no bl.mailspike.net bl.mailspike.org bl.mav.com.br bl.mipspace.com bl.nszones.com block.ascams.com block.blars.org block.dnsbl.sorbs.net blocked.asgardnet.org blocked.hilli.dk blocklist2.squawk.com blocklist.squawk.com block.me.uk block.rhs.mailpolice.com block.stopspam.org blocktest.relays.osirusoft.com bl.open-whois.org bl.redhatgate.com bl.reynolds.net.au bl.scientificspam.net bl.score.senderscore.com bl.scrollout.com bl.shlink.org bl.shlink.orgdul.ru bl.spamcannibal.org bl.spamcop.net bl.spameatingmonkey.net bl.spamstinks.com bl.spamthwart.com bl.spam-trap.net bl.starloop.com bl.student.pw.edu.pl bl.summersault.com bl.suomispam.net bl.technovision.dk bl.techtheft.info bl.tiopan.com bl.tolkien.dk bogon.bl.techtheft.info bogon.lbl.lagengymnastik.dk bogons.cymru.com bogons.dnsiplists.completewhois.com bogusmx.rfc-clueless.org bogusmx.rfc-ignorant.org bsb.empty.us bsb.spamlookup.net bulk.rhs.mailpolice.com c10.rbl.hk cabal.web-o-trust.org cabl.rbl.webiron.net cart00ney.surriel.com catchspam.com cbl.abuseat.org cbl.anti-spam.org.cn cblless.anti-spam.org.cn cblplus.anti-spam.org.cn cbs.lumbercartel.org cdl.anti-spam.org.cn china.rominet.net cidr.bl.mcafee.com client-domain.sjesl.monkeys.com cml.anti-spam.org.cn combined.abuse.ch combined-HIB.dnsiplists.completewhois.com combined.njabl.org combined.rbl.msrbl.net communicado.fmb.la conferr.bl.techtheft.info contacts.abuse.net countries.blackholes.us country.dnsbl.solid.net country.dnsbl.souphost.com country.netop.org country-rirdata.dnsiplists.completewhois.com crawler.rbl.webiron.net csi.cloudmark.com czdynamic.drbl.ks.cz dbl.spamhaus.org dbl.suomispam.net dbl.tiopan.com db.rurbl.ru db.wpbl.info ddnsbl.internetdefensesystems.com delayed-outputs.orbs.org dev.null.dk devnull.drbl.be.net.ru dews.qmail.org dhcp.tqmcube.com dialup.blacklist.jippg.org dialup.drbl.sandy.ru dialup.rbl.kropka.net dialups.mail-abuse.org dialups.relays.osirusoft.com dialups.visi.com dmm.shlink.org dnsbl-0.uceprotect.net dnsbl1.dnsbl.borderware.com dnsbl-1.uceprotect.net dnsbl2.dnsbl.borderware.com dnsbl-2.uceprotect.net dnsbl3.dnsbl.borderware.com dnsbl-3.uceprotect.net dnsbl6.anticaptcha.net dnsbl.abuse.ch dnsbl.ahbl.org dnsbl.allgeek.net dnsbl.anticaptcha.net dnsbl.antispam.or.id dnsbl.aspnet.hu dnsbl.burnt-tech.com dnsbl.calivent.com.pe dnsbl.cbn.net.id dnsblchile.org dnsbl.clue-by-4.org dnsbl.cmbix.com dnsbl.cobion.com dnsbl.cyberlogic.net dnsbl.delink.net dnsbl.dronebl.org dnsbl.forefront.microsoft.com dnsbl.httpbl.org dnsbl.inps.de dnsbl.ioerror.us dnsbl.ipocalypse.net dnsbl.isoc.bg dnsbl.jammconsulting.com dnsbl.justspam.org dnsbl.kempt.net dnsbl.madavi.de dnsbl.mags.net dnsbl.mailer.mobi dnsbl.mailshell.net dnsbl.mcu.edu.tw dnsbl.net.ua dnsbl.njabl.org dnsbl.openresolvers.org dnsbl.othello.ch dnsbl.pagedirect.net dnsbl.proxybl.org dnsbl.rangers.eu.org dnsbl.regedit64.net dnsbl.rizon.net dnsbl.rv-soft.info dnsbl.rymsho.ru dnsbl.solid.net dnsbl.sorbs.net dnsbl.spam-champuru.livedoor.com dnsbl.spfbl.net dnsbl.stopspam.org dnsbl.swiftbl.org dnsbl.technoirc.org dnsbl.tornevall.org dnsbl.tqmcube.com dnsbl.webequipped.com dnsbl.wpbl.pc9.org dnsbl.zapbl.net dnsbl.zetabl.org dnsrbl.org dnsrbl.swinog.ch dnswl.inps.de dnswl.isoc.bg dnswl.leisi.net dob.sibl.support-intelligence.net domain.bl.techtheft.info drone.abuse.ch dronebl.noderebellion.net dsbl.dnsbl.net.au dsn.bl.rfc-ignorant.de dsn.rfc-clueless.org dsn.rfc-ignorant.org dssl.imrss.org duinv.aupads.org dul.blackhole.cantv.net dul.dnsbl.borderware.com dul.dnsbl.sorbs.net dul.dnsbl.sorbs.netdul.ru dul.maps.vix.com dul.orca.bc.ca dul.pacifier.net dul.ru dun.dnsrbl.net dunk.dnsbl.tuxad.de dyn2.dnsbl.epaxsys.net dyn2.sbg-rbl.org dynablock.easynet.nl dynablock.njabl.org dynablock.sorbs.net dynablock.wirehub.net dynamic.dnsbl.rangers.eu.org dynamic.rhs.mailpolice.com dyna.spamrats.com dyn.dnsbl.epaxsys.net dyndns.rbl.jp dynip.rothen.com dyn.nszones.com dyn.sbg-rbl.org dyn.shlink.org elitist.rfc-clueless.org endl.dnsbl.net.au endn.bl.reynolds.net.au endn.dnsbl.net.au enpb.dnsbl.net.au escalations.dnsbl.sorbs.net eswlrev.dnsbl.rediris.es eurospam.spamblocked.com ex.dnsbl.org exemptions.ahbl.org exitnodes.tor.dnsbl.sectoor.de exitnodes.tor.dnsbl.sectoor.dehttp.dnsbl.sorbs.net expanded.bl.techtheft.info feb.spamlab.com fl.chickenboner.biz flowgoaway.com fnrbl.fast.net forbidden.icm.edu.pl formmail.relays.monkeys.com form.rbl.kropka.net fraud.rhs.mailpolice.com free.v4bl.org fresh10.spameatingmonkey.net fresh15.spameatingmonkey.net fresh.dict.rbl.arix.com fresh.sa_slip.rbl.arix.com fresh.spameatingmonkey.net fulldom.rfc-clueless.org generic.rwl.mailabusedatabase.com geobl.spamanalysis.org geobl.spameatingmonkey.net gl.suomispam.net good.whois.bl.techtheft.info grey.uribl.com hardcore.rbl.sns.ro hartkore.dnsbl.tuxad.de hbl.atlbl.net helo-domain.sjesl.monkeys.com hijacked.dnsiplists.completewhois.com hil.habeas.com hog.blackhole.cantv.net hong-kong.rominet.net hostkarma.junkemailfilter.com hostkarma.junkemailfilter.com[brl] httpbl.abuse.ch http.dnsbl.sorbs.net http.opm.blitzed.org hul.habeas.com iadb2.isipp.com iadb.isipp.com iana-classa.bogons.dnsiplists.completewhois.com iddb.isipp.com images.rbl.msrbl.net impersonator.lists.spam.sux.com in.dnsbl.org inflow.noflow.org inputs.orbs.org inputs.orbz.org inputs.relays.osirusoft.com intercept.datapacket.net intruders.docs.uu.se invalidipwhois.dnsiplists.completewhois.com ipal.ahbl.org ipbl.mailhosts.org ipbl.zeustracker.abuse.ch ip.rbl.kropka.net ips.backscatterer.org ips.whitelisted.org ip.v4bl.org ipv6.all.dnsbl.bit.nl ipv6.all.s5h.net ipv6.blacklist.woody.ch ipv6.rbl.choon.net ipv6.rwl.choon.net ipwhois.rfc-ignorant.org ipwl.mailhosts.org ircbl.ahbl.org isp.bl.techtheft.info isp.dns.nzl.net ispmx.pofon.foobar.hu isps.spamblocked.com is-tor.kewlio.net.uk ix.dnsbl.manitu.net jms.lumbercartel.org jp.dialup.blacklist.jippg.org jp.surbl.org jwrh.dnsbl.net.au karmasphere.email-sender.dnsbl.karmasphere.com karmasphere.email-sender.dnswl.karmasphere.com korea.rominet.net korea.services.net ko.tqmcube.com ksi.dnsbl.net.au l1.apews.org l1.apews.rhsbl.sorbs.net l1.apews.rhsbl.uceprotect.net l1-apews.tqmcube.com l1.bbfh.ext.sorbs.net l1.spews.dnsbl.sorbs.net l2.apews.dnsbl.sorbs.net l2.apews.dnsbl.uceprotect.net l2.apews.org l2-apews.tqmcube.com l2.bbfh.ext.sorbs.net l2.spews.dnsbl.sorbs.net l3.bbfh.ext.sorbs.net l4.bbfh.ext.sorbs.net lacnic-main.bogons.dnsiplists.completewhois.com lacnic.spamblocked.com lame-av.rbl.kropka.net lame.dnsbl.rangers.eu.org lbl.lagengymnastik.dk list.anonwhois.net list.bbfh.org list.blogspambl.com list.dnswl.org list.dsbl.org list.quorum.to lists.spam.sux.com lookup.dnsbl.iip.lu luckyseven.dnsbl.net mail-abuse.blacklist.jippg.org mailabusedatabase.com maildeflector.net mail.people.it manual.orbs.org manual.orbz.gst-group.co.uk map.spam-rbl.com misc.dnsbl.sorbs.net mr-out.imrss.org msgid.bl.gweep.ca mtawlrev.dnsbl.rediris.es multihop.dsbl.org multi.surbl.org multi.uribl.com nana.bl.techtheft.info netblockbl.spamgrouper.com netblockbl.spamgrouper.to netblock.dnsl.ipquery.org netblock.pedantic.org netbl.spameatingmonkey.net netscan.rbl.blockedservers.com new.dnsbl.sorbs.net new.spam.dnsbl.sorbs.net niku.2ch.net nlwhitelist.dnsbl.bit.nl nml.mail-abuse.org nobl.junkemailfilter.com nomail.rhsbl.sorbs.net no-more-funn.moensted.dk nonconfirm.mail-abuse.org non-jp.dialup.blacklist.jippg.org noptr.spamrats.com noservers.dnsbl.sorbs.net nospam.ant.pl nsbl.fmb.la ob.surbl.org ohps.dnsbl.net.au okrelays.nthelp.com old.dnsbl.sorbs.net old.spam.dnsbl.sorbs.net omrs.dnsbl.net.au openlist.relays.osirusoft.com openlists.orbs.org opm.blitzed.org opm.tornevall.org op.rbl.kropka.net orbs.dorkslayers.com orbz.gst-group.co.uk orid.dnsbl.net.au origin6.asn.cymru.com origin.asn.cymru.com origin.asn.spameatingmonkey.net or.orbl.org or.rbl.kropka.net orrh.dnsbl.net.au orvedb.aupads.org osps.dnsbl.net.au osrs.dnsbl.net.au other.bl.techtheft.info outputs.orbs.org outputs.orbz.org outputs.relays.osirusoft.com owfs.dnsbl.net.au owps.dnsbl.net.au pacbelldsl.compu.net Paidaccessviarsync pbl.spamhaus.org pdl.bl.reynolds.net.au pdl.bofh.it pdl.dnsbl.net.au pdl.pan-am.ca peer.asn.cymru.com phishing.rbl.msrbl.net ph.surbl.org plus.bondedsender.org pm0-no-more.compu.net pofon.foobar.hu policy.lbl.lagengymnastik.dk pool.dnsbl.solid.net porn.rhs.mailpolice.com postmaster.rfc-clueless.org postmaster.rfc-ignorant.org ppbl.beat.st prc.tqmcube.com probes.dnsbl.net.au probes.dnsbl.net.auproxy.bl.gweep.ca problems.dnsbl.sorbs.net proxies.blackholes.easynet.nl proxies.blackholes.wirehub.net proxies.dnsbl.sorbs.net proxies.exsilia.net proxies.mail-abuse.org proxies.relays.monkeys.com proxy.bl.gweep.ca proxy.block.transip.nl proxy.drbl.be.net.ru proxy.relays.osirusoft.com psbl.surriel.com pss.spambusters.org.ar public.sarbl.org pub.senderdb.net q.mail-abuse.com query.bondedsender.org query.senderbase.org query.trustic.com rabl.nuclearelephant.com random.bl.gweep.ca rbl2.triumf.ca rbl.abuse.ro rbl.apluslock.com rbl.atlbl.net rbl.blakjak.net rbl.blockedservers.com rbl.bulkfeeds.jp rbl.cbn.net.id rbl.choon.net rbl.dns-servicios.com rbl.echelon.pl rbl.efnethelp.net rbl.efnet.org rbl.efnetrbl.org rbl.eznettools.com rbl.fasthosts.co.uk rbl.faynticrbl.org rbl.firstbase.com rbl.fnidder.dk rbl.init1.nl rbl.interserver.net rbl.iprange.net rbl.ipv6wl.eu rbl.ipv6-world.net rbl.jp rbl.lugh.ch rbl.mail-abuse.org rbl.ma.krakow.pl rbl.maps.vix.com rblmap.tu-berlin.de rbl.megarbl.net rbl.mw-internet.net rbl.ntvinet.net rbl-ok.uib.no rbl.openrbl.org rbl.orbitrbl.com rbl.pil.dk rbl-plus.hea.net rbl-plus.mail-abuse.org rbl.polarcomm.net rbl.rbldns.ru rbl.realtimeblacklist.com rbl.rope.net rbl.schulte.org rbl.snark.net rbl.spamlab.com rbl.spam.org.tr rbl.stonehenge.com rbl.suresupport.com rbl.talkactive.net rbl.tdk.net rbl.triumf.ca rbl.uib.no rbl.zenon.net rddn.dnsbl.net.au rdts.bl.reynolds.net.au rdts.dnsbl.net.au recent.dnsbl.sorbs.net recent.spam.dnsbl.sorbs.net redir.rhs.mailpolice.com red.uribl.com reject.the-carrot-and-the-stick.com relay.dnsl.ipquery.org relayips.rbl.shub-inter.net relays.bl.gweep.ca relays.bl.kundenserver.de relays.dnsbl.sorbs.net relays.dorkslayers.com relays.mail-abuse.org relays.nether.net relays.nthelp.com relays.orbs.org relays.ordb.org relays.osirusoft.com relays.radparker.com relays.sandes.dk relays.visi.com relaywatcher.n13mbl.com rep.mailspike.net reputation-domain.rbl.scrolloutf1.com reputation-ip.rbl.scrolloutf1.com reputation-ns.rbl.scrolloutf1.com residential.block.transip.nl rf.senderbase.org rhsbl.ahbl.org rhsbl.blackhole.cantv.net rhsbl.mailhosts.org rhsbl.rymsho.ru rhsbl.scientificspam.net rhsbl.shlink.org rhsbl.sorbs.net rhsbl.zapbl.net rhswl.mailhosts.org rhswl.shlink.org ricn.dnsbl.net.au ripe-main.bogons.dnsiplists.completewhois.com r.mail-abuse.com rmst.dnsbl.net.au robot.bl.techtheft.info rot.blackhole.cantv.net rsbl.aupads.org rwl.choon.net sa-accredit.habeas.com safe.dnsbl.prs.proofpoint.com safe.dnsbl.sorbs.net sa.fmb.la sa.senderbase.org satos.rbl.cluecentral.net sbbl.they.com sbg.sbg-rbl.org sbl.2stepback.dk sbl.csma.biz sbl.nszones.com sbl.spamhaus.org sbl-xbl.spamhaus.org scanning.bl.techtheft.info schizo-bl.kundenserver.de score.senderscore.com sc.surbl.org sender-address.sjesl.monkeys.com sender-domain.sjesl.monkeys.com sender-domain-validate.sjesl.monkeys.com service.mailblacklist.com service.mailwhitelist.com short.fmb.la shortlist.mailhosts.org short.rbl.jp singlebl.spamgrouper.com single.dnsl.ipquery.org singular.ttk.pte.hu smtp.dnsbl.sorbs.net sober.bl.spamtraps.org socks.dnsbl.sorbs.net socks.opm.blitzed.org socks.relays.osirusoft.com softcore.rbl.sns.ro sohul.habeas.com sorbs.dnsbl.net.au source.bl.techtheft.info spam.abuse.ch spam.blackhole.cantv.net spamblock.kundenserver.de spambot.bls.digibase.ca spam.dnsbl.anonmails.de spam.dnsbl.rangers.eu.org spam.dnsbl.sorbs.net spam.dnsrbl.net spamdomain.block.transip.nl spamdomains.blackholes.easynet.nl spam.exsilia.net spamflood.drbl.drand.net spamguard.leadmon.net spamhaus.relays.osirusoft.com spamips.rbl.shub-inter.net spam.lbl.lagengymnastik.dk spamlist.or.kr spammers.v6net.org spam.olsentech.net spam.pedantic.org spamprobe.drbl.drand.net spam.rbl.blockedservers.com spamrbl.imp.ch spam.rbl.msrbl.net spam.shri.net spamsites.dnsbl.net.au spamsites.relays.osirusoft.com spamsource.block.transip.nl spamsource-netblocks.orbs.org spamsources.dnsbl.info spamsources.fabel.dk spamsources.orbs.org spamsources.relays.osirusoft.com spamsources.spamblocked.com spamsources.yamta.org spam.spamrats.com spamsupport.dnsbl.rangers.eu.org spam.tqmcube.com spamtrap.drbl.drand.net spamtrap.trblspam.com spam.wonk.org spam.wytnij.to spam.zapjunk.com spbl.bl.winbots.org spews.block.transip.nl spews.dnsbl.net.au spews.relays.osirusoft.com spider.realtimespiderlist.com srnblack.surgate.net srn.surgate.net stabl.rbl.webiron.net stale.dict.rbl.arix.com stale.sa_slip.arix.com st.technovision.dk superblock.ascams.com support.bl.techtheft.info surbl.dnsbl.net.au swl.spamhaus.org t1.dnsbl.net.au t2.dnsbl.net.au t3direct.dnsbl.net.au t3.dnsbl.net.au taiwan.rominet.net test.blocklist.org tor.ahbl.org tor.dan.me.uk tor.dnsbl.sectoor.de tor.efnet.org torexit.dan.me.uk torserver.tor.dnsbl.sectoor.de truncate.gbudb.net trusted.nether.net trust.trustmymail.org ubl.lashback.com ubl.nszones.com ubl.unsubscore.com ucepn.dnsbl.net.au unconfirmed.dsbl.org unsure.nether.net untestable-netblocks.orbs.org uribl.abuse.ro uri.blacklist.woody.ch uri-bl.blbl.org uribl.pofon.foobar.hu uribl.spameatingmonkey.net uribl.swinog.ch uribl.zeustracker.abuse.ch urired.spameatingmonkey.net url.rbl.jp v4.fullbogons.cymru.com v6.fullbogons.cymru.com vbl.messagelabs.com vbl.mookystick.com virbl.bit.nl virbl.dnsbl.bit.nl virus.bl.techtheft.info virus.rbl.jp virus.rbl.msrbl.net vote1.drbl.ks.cz vote.drbl.be.net.ru vote.drbl.caravan.ru vote.drbl.croco.net vote.drbl.dataforce.net vote.drbldf.dsbl.ru vote.drbl.drand.net vote.drbl.gremlin.ru vote.drbl.host.kz vote.drbl.sandy.ru vote.rbl.ntvinet.net vouch.dwl.spamhaus.org vox.schpider.com wadb.isipp.com watchlist.bl.techtheft.info wbl.triumf.ca wdl.bl.reynolds.net.au web.bl.techtheft.info web.dnsbl.sorbs.net webmail.rhs.mailpolice.com web.rbl.msrbl.net white.dnsbl.securityplanet.nl whitelist.bl.techtheft.info whitelist.lumbercartel.org whitelist.rbl.ispa.at whitelist.sci.kun.nl whitelist.sci.ru.nl whitelist.spamblocked.com whitelist.surriel.com whitelist.techtheft.info white.uribl.com whois.bl.techtheft.info whois.rfc-clueless.org whois.rfc-ignorant.org will-spam-for-food.eu.org wingate.opm.blitzed.org wl.mailspike.net wl.nszones.com wl.shlink.org wl.summersault.com wl.trusted-forwarder.org work.drbl.caravan.ru work.drbl.croco.net work.drbl.dataforce.net work.drbldf.dsbl.ru work.drbl.drand.net work.drbl.gremlin.ru work.drbl.host.kz work.drbl.ks.cz work.drbl.sandy.ru world.tqmcube.com worm.dnsbl.rangers.eu.org wormrbl.imp.ch worms-bl.kundenserver.de wpb.bl.reynolds.net.au wpbl.dnsbl.net.au ws.surbl.org xbl.selwerd.cx xbl.spamhaus.org xpews.mailhosts.org xs.surbl.org ybl.megacity.org zebl.zoneedit.com zen.spamhaus.org z.mailspike.net zombie.dnsbl.sorbs.net zta.birdsong.org ztl.dorkslayers.com zz.countries.nerd.dk " # simple shell function to show an error message and exit # $0 : the name of shell script, $1 is the string passed as argument # >&2 : redirect/send the message to stderr ERROR() { echo $0 ERROR: $1 >&2 exit 2 } # -- Sanity check on parameters [ $# -ne 1 ] && ERROR 'Please specify a single IP address' # -- if the address consists of 4 groups of minimal 1, maximal digits, separated by '.' # -- reverse the order # -- if the address does not match these criteria the variable 'reverse will be empty' reverse=$(echo $1 | sed -ne "s~^\([0-9]\{1,3\}\)\.\([0-9]\{1,3\}\)\.\([0-9]\{1,3\}\)\.\([0-9]\{1,3\}\)$~\4.\3.\2.\1~p") if [ "x${reverse}" = "x" ] ; then ERROR "IMHO '$1' doesn't look like a valid IP address" exit 1 fi # Assuming an IP address of 11.22.33.44 as parameter or argument # If the IP address in $0 passes our crude regular expression check, # the variable ${reverse} will contain 44.33.22.11 # In this case the test will be: # [ "x44.33.22.11" = "x" ] # This test will fail and the program will continue # An empty '${reverse}' means that shell argument $1 doesn't pass our simple IP address check # In that case the test will be: # [ "x" = "x" ] # This evaluates to true, so the script will call the ERROR function and quit # -- do a reverse ( address -> name) DNS lookup REVERSE_DNS=$(dig +short -x $1) echo IP $1 NAME ${REVERSE_DNS:----} # -- cycle through all the blacklists for BL in ${BLISTS} ; do # show the reversed IP and append the name of the blacklist printf "%-60s" " ${reverse}.${BL}." # use dig to lookup the name in the blacklist #echo "$(dig +short -t a ${reverse}.${BL}. | tr '\n' ' ')" LISTED="$(dig +short -t a ${reverse}.${BL}.)" echo ${LISTED:----} done
Have questions regarding e-mail blacklists and how they work? Well, when I have more time I will surely post about it but for now, you may just leave a comment below and I will reply when I can.
HI Denis,
You could make the reversed IP with something like that, which is more readable):
reverse=$($1 | awk -F “.” ‘{print $4″.”$3″.” $2″.”$1}’)
Can you make an update of the script?
a) example add more domain, IP4 and IP6 black list checks
b) if it is blacklisted also add after result the word “Blacklisted”
c) we can run the script one time for multiple domains, ip4 and ip6
and filter out only Blacklisted
# Pipe with other UNIX utils, eg. grep. Only blacklisted:
$ ./bl domain.tld | grep “blacklisted”
example is here
https://github.com/adionditsak/blacklist-check-unix-linux-utility
Hi,
Thanks for your input. I may get on it next week 😉