dig +short txt <keyword>.wp.dg.cx

Query Wikipedia via console over DNS

Query Wikipedia by issuing a DNS query for a TXT record. The TXT record will also include a short URL to the complete corresponding Wikipedia entry.You can also write a little shell script like: $ cat wikisole.sh #!/bin/sh dig +short txt ${1}.wp.dg.cx and run it like ./wikisole.sh unix were your first option ($1) will be used as search term.
Sample Output
$ dig +short txt unix.wp.dg.cx
"Unix (officially trademarked as UNIX, sometimes also written as Unix with small caps) is a computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Douglas McIlroy, and Joe O" "ssanna. Today's Unix systems are split into various branches, developed over time by AT&T as well as various commercial... http://a.vu/w:Unix"

210
By: drizzt
2009-07-31 16:08:59

6 Alternatives + Submit Alt

What Others Think

this is awesomely wacky
unixx · 459 weeks and 2 days ago
Vote this up. One can feel the awesome behind this command :-)
Alanceil · 459 weeks and 1 day ago
cute DNS abuse :)
penpen · 459 weeks and 1 day ago
Very very cool.
qubyte · 459 weeks and 1 day ago
We can add some GUI spice to teh absue :P , dep==> zenity zenity --info --text="$(dig +short txt $(zenity --entry --title="Search wiki" --text="Enter your search word:").wp.dg.cx)"
hemanth · 459 weeks ago
This is simply awesome. In the shell script example, add quotes around the "${1}" and you can do multi-word searches using quotes in your arg, like: ./wikip.sh "gradient descent"
zombiedeity · 458 weeks and 5 days ago
Script with prettified output: cat wikisole.sh #!/bin/sh COLUMNS=`tput cols` dig +short txt "${1}".wp.dg.cx | sed -e 's/" "//g' -e 's/^"//g' -e 's/"$//g' -e 's/ http:/\n\nhttp:/' | fmt -w $COLUMNS
philipsd6 · 458 weeks and 5 days ago
philipsd6's version as a function in bashrc: function wiki () { COLUMNS=`tput cols` dig +short txt ${1}.wp.dg.cx | sed -e 's/" "//g' -e 's/^"//g' -e 's/"$//g' -e 's/ http:/\n\nhttp:/' | fmt -w $COLUMNS }
bstaz · 458 weeks and 5 days ago
You can also search for more than one word like this: dig +short txt "multiple words".wp.dg.cx I wrote a wrapper script that takes either 1 word or multiple words and formulates the syntax properly: #!/bin/bash function help { echo -e "\n\tusage: $0 " exit } if [ -z "$1" ]; then help fi while [ "$1" != "" ]; do if [ "$SEARCH" = "" ]; then SEARCH="$1" else SEARCH="$SEARCH $1" fi shift done echo -e "\n\tLooking up $SEARCH\n" dig +short txt "$SEARCH".wp.dg.cx echo ""
omish_man · 458 weeks and 4 days ago
I hate dig. Why not use: host -t txt linux.wp.dg.cx
vutcovici · 458 weeks and 3 days ago
Simpler multiple words fix: dig +short txt "`echo $@`".wp.dg.cx
peter0081 · 454 weeks and 2 days ago
dig +short txt <keyword>.wp.dg.cx | espeak
matthewbauer · 452 weeks and 1 day ago
I wonder if we can do that with French language ( fr.wikipedia.org ) Like with this example : fr.wikipedia.org/wiki/Tse
sputnick · 437 weeks and 6 days ago
mwiki () { echo $@ > foo; blah=`sed 's/ /_/g' foo`; dig +short txt $blah.wp.dg.cx; } Sample output: mwiki snow leopard "The snow leopard (Uncia uncia or Panthera uncia), sometimes known as \"ounce,\" is a moderately large cat native to the mountain ranges of Central Asia. The classification of this species has been subject to change and its exact taxonomic position is still " "unclear.
oshazard · 435 weeks and 3 days ago
#! /bin/bash echo please input your subject read SUBJECT dig +short txt SUBJECT.wp.dg.cx
ethnopunk · 426 weeks and 2 days ago
Shorter version, works with multiple words: mwiki() { dig +short txt "$*".wp.dg.cx; }
dorin · 425 weeks and 1 day ago
on windows: nslookup -q=txt shit.wp.dg.cx
unixmonkey9108 · 424 weeks and 4 days ago
"slookup -q=txt" does not appear to be valid (i have WinXP+SP3)...
bugmenot · 404 weeks and 5 days ago
sorry, in mean "Nslookup -q=txt"...
bugmenot · 404 weeks and 5 days ago
Nice. These dns lookups seems faster than an actual http request. But I don't like the disturbing " and \ and the missing linebreaks. Therefore by combining dorin's ID with a sed and fmt I get to: mwiki() { dig +short txt $(echo $* | sed 's/ /_/g').wp.dg.cx|sed -E "s/\" \"|^\"|\"$|\\\\//g"|fmt; }
unixmonkey12820 · 397 weeks and 1 day ago
what do you need this for? has it some advantages to to such a query over DNS? why can't you use curl instead?
rubo77 · 395 weeks and 4 days ago
how to convert the utf-8 encode result to itf-8? e.g. when I query "Leon", I got "L\195\169on". I tried to convert is using "echo -e", but echo only support \xC3\xA9 format.
hileon · 301 weeks and 2 days ago
This command is great. But when I run it now I get: ;; connection timed out; no servers could be reached Anyone know what's wrong? I looks like Wikipedia is blocking dns requests or something else has changed.
JokesOnYou · 276 weeks and 1 day ago
JokesOnYou ... not sure exactly but you can stipulate the nameserver to query as a swich to dig, ie (using opendns). dig @resolver1.opendns.com +short txt "${1}".wp.dg.cx
khayyam · 269 weeks and 2 days ago
But does this work?~
ohuhu · 233 weeks and 3 days ago
I mean how does this work
ohuhu · 233 weeks and 3 days ago
It didn't work as expected. Blocked by Wikipedia?
cwchentw · 157 weeks and 1 day ago
For those wondering, it's a part of the dnsutils package on Debian.
scurge · 156 weeks and 3 days ago
Doesn't work for me. Looks like there is no NS record for wp.dg.cx any more. Maybe they couldn't handle being commandlinefu'd. % dig +short txt linux.wp.dg.cx % dig -t txt linux.wp.dg.cx ; DiG 9.4.3 -t txt linux.wp.dg.cx ;; global options: +cmd ;; Got answer: ;; ->>HEADER ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;linux.wp.dg.cx. IN TXT % dig -t ns wp.dg.cx ; DiG 9.4.3 -t ns wp.dg.cx ;; global options: +cmd ;; Got answer: ;; ->>HEADER ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;wp.dg.cx. IN NS
jrdld · 143 weeks and 2 days ago
does not work anymore too bad
tlemerond · 142 weeks and 3 days ago
Doesn't work anymore :(
skytux · 111 weeks ago
scream, www.beatsbydrdre.co.com or www.burberry-handbags2016.in.net enjoy www.tomsshoes-outlet.us.com the www.christianlouboutin.org.uk cicadas www.michaelkors.com.se flap www.tommy-hilfigeroutlet.com its www.nikestore.us wings www.wedding--dresses.ca when www.ralphlaurenoutlet-online.us.com you bring www.timberlandbootsoutlet.us.com the www.chiflatiron.net.co cool www.cheapshoes.com.co wind; www.rolex-watch.me.uk when www.cheapoakley-sunglasses.in.net passing www.barbour-factory.com Hasuike also www.michael-kors-taschen.com.de puffed www.newbalance-shoes.org breath www.gucci-shoes.net goods www.michaelkorsoutlet.ar.com products www.hollisters-canada.ca that www.coach-outletonline.net.co Lotus aroma; www.asicsgels.de hours www.mcmbags.net because www.oakleysunglass-outlet.net ignorance www.lululemon-australia.com.au has www.michael-kors.com.co been www.burberry-outletstore.net poked www.asics-outlet.us.com hornet's www.kate-spade.in.net nest and airmax.shoesoutlet.us.com stung www.omegarelojes.es his www.juicycouture.com.co face www.vans-shoes.co.uk was www.tommy-hilfiger-canada.ca bruised. www.nike-maxfr.com Dig www.eyeglassframes.in.net once, www.oakleysunglasses-cheap.in.net because www.longchamphandbagsoutlet.net "small www.airjordans.us insects" www.longchamp-handbagsoutlet.us.com (Sparrow) www.hollister-abercrombie.com.se and www.ralphlauren-polos.com.co took www.burberryoutlet-canada.ca out www.reebok.com.de a "snake" www.juicycoutureoutlet.net.co (Snake) www.gucci-outletstore.com scared to www.outlet-burberry.net.co fall www.burberrys-outlet.co.uk from www.montblanc--pens.in.net the www.jimmy-chooshoes.com wall. www.nikefactory.org Fortunately, www.soft-ballbats.com nothing www.nike-air-max.ca serious. www.nike-tnrequinpascher.fr Leisure www.ralphlaurenoutletonline.us.org time, www.new-balance-schuhe.de will www.louis-vuittonoutletcanada.ca collect www.toms-shoes.net.co some www.converse-shoesoutlet.com cigarette www.air-huarache.co.uk paper www.polo-ralph-lauren.de folded airmax.misblackfriday.com triangle, www.hermesbirkin-bag.net and www.michaeljordan.com.de partners www.soccer-shoes.us.com to www.nike-skor.com.se play; www.adidas--canada.ca (the www.converse-shoes.net triangle www.guccishoes.com.co on the ground www.nikeskos.dk and www.michaelkors-outlet-online.com.co put www.cheapmichaelkors.us.org his www.abercrombie-kids.us.com hand www.nike-roshe-run.de on www.supra-shoes.org the www.tommy-hilfiger-online-shop.de ground www.thejoreseproject.com quick www.nike-air-max.us photo www.oakley.com.de shoot www.polooutlets-store.com the other www.beats-headphone.com.co side www.christian-louboutin-shoes.ca of www.louis--vuitton.org.uk the triangle www.kate-spade.gb.net is www.burberryoutlet2016.us.com the www.coachoutletstore.net.co triangle that turned www.nike-air-force.de their www.rayban-sunglassesoutlet.co.uk a); www.oakleys-glasses.us.com and www.abercrombie-and-fitch.us.com also www.airmax-90.org than www.rolex-watches.us.com own www.mmoncler-outlet.com older brother www.cheap-jordans.net and www.nikefree-run.org.uk sister www.air-max.com.de were www.swarovski--uk.me.uk led www.toryburchsale.com.co to www.ghd-hairstraightener.net a www.burberry2016.co.uk wide www.tiffanyand-co.net.co flat www.ray-banocchiali.it on www.soccer-shoesoutlet.com the www.newbalance.com.es grass www.ugg-australia.com.de or www.the-northface.com.co doing www.rayban-wayfarer.in.net "of www.ugg-bootsclearance.com chicken" airhuarache.shoesoutlet.us.com or www.uggboots.net.co "kill nike.shoesoutlet.us.com the www.ray-ban-outlet.us.com lamb" www.mizuno-running.net of www.pulseras-pandora.com.es the www.burberryonlineshop.de game, www.katespadeoutlet.gb.net before www.harrods-london.co.uk the www.guccihandbags.net.co election www.timberlandshoes.net.co when www.thenorthfacejackets.net.co one eagle, www.p90xworkout.us.com then www.ralph-laurens.org.uk tall www.designerhandbagsoutlet.net.co in www.burberryoutlet-sale.in.net front www.louis-vuittonblackfriday.com when www.tommyhilfigeroutlet.in.net hens www.mcmsworldwide.com , www.gucci-taschen-outlet.de when the www.nike-air-max.com.se rest www.jordanrelease-dates.us.com of www.thenorth-faces.co.uk the chicken, www.maccosmetics.net.co the www.toryburch-sandals.in.net eagle www.burberry-outlet.net.co chasing www.burberry-outletonlinesale.in.net shot at www.the-northface.net.co the www.michael-korshandbags.org.uk back www.chanel-bags.com.co of www.cheap-raybans.com the www.chanelhandbags.net.in chick, www.longchamp.com.co hen www.timberlands-paschere.fr with open www.oakleyoutlet.ar.com arms www.nfl-jersey.us.com to www.insanity-workout.us.com protect www.nike-schuhe.com.de chickens, www.ferragamoshoes.in.net smart www.poloralphlaurenoutlet.net.co dodge www.eyeglassesonline.us.com to www.oakleys-sunglasses.us.com keep www.designer-handbagsoutlet.us.com eagle www.pumaonline-shop.de patting. www.michaelkors.co.nl Or www.airhuarache.co.uk a www.michaelkorsoutletonline-sale.us.com dozen www.rosheruns.us people www.marcjacobs.us.com sitting www.iphone-cases.net.co in www.tommyhilfiger.net.co a www.oakley-sunglasses.mex.com circle, www.michael-kors.com.es do www.mkoutletonline.us.com a www.newbalance-outlet.org do www.handbagsoutlet.net.co Diushou www.nikefree5.net Juan www.louisvuittons.com.co game: www.swarovski-online-shop.de the www.beats-by-dre.com.co hands www.bcbg-max-azria.ca of www.newoutletonlinemall.com only www.tiffany-jewelry.net one www.ralphlaurenpolos.in.net person www.canada-goosesjackets.us.com to take the handkerchief www.nike-air-max.com.au out www.burberrybags-outlet.com of www.coco-chanel.com.de his mouth www.coachblackfriday.com in www.woolrich-clearance.com a www.oakley--sunglasses.com.au circle www.guccioutlet-sale.in.net singing www.calvin-kleins.us.com Diushou www.horloges-rolex.nl Juan www.ralphs-lauren.co.uk songs, uggaustralia.misblackfriday.com danced www.polos-ralphlauren.us.com around the www.retro-jordans.com circle www.tommy-hilfiger.co.nl turning www.converse.net.co quietly www.abercrombie-hollister.nl throw www.rayban.co.nl the www.pumashoes.in.net handkerchief www.burberry-handbagsoutlet.com.co in www.coach-factoryyoutletonline.net the www.coachoutletstore-online.com.co back www.swarovskijewelry.com.co of www.truereligion-outlet.us.org a www.polo-outlets.com.co person. www.prada-shoes.com.co Then www.pandora-charms-canada.ca run around in www.coach-factoryoutlet.net.co circles. www.toms--outlet.com.co If www.tomsoutlet-online.com you www.ugg-boots.us.org have www.hollisterclothingstore.org a www.abercrombieand-fitch.ca lap www.nike-huarache.nl behind www.guccishoes.in.net the www.hollister-clothing.in.net handkerchief www.pandora-charms.org.uk patting, www.giuseppe-zanotti.net this www.salvatoreferragamo.in.net people have www.christian--louboutin.in.net not www.bcbg-dresses.com found www.ray--ban.ca the www.ghdhair-straighteners.co.uk person www.ralphlaurenepolo.com you www.adidas-superstar.de want www.basketballshoes.com.co to www.airmax-2015.org give www.abercrombie-fitchs.us.com a www.pandorajewellery.com.au performance www.lululemonoutlet.gb.net for www.michaelkorsoutlet-online.ar.com everyone; www.nike-air-max.com.de a www.nike-schoenen.co.nl joke, www.longchamp.com.de sing www.burberrys-outlet2016.com songs, www.cheaprayban.com.co or back www.tommy-hilfiger.com.de poem. www.tomsoutletonline.net Then www.nikeshoesoutlet.org.uk began www.louis-vuitton-australia.com.au Diushou www.raybans-sunglassesoutlet.in.net Juan www.hermesbags.jp.net by www.marc-jacobs.us.com him www.uggs.in.net or www.nike-shoesoutlet.us.com her. www.pradaoutlet.com.co If www.thomas-sabo.com.de this www.cheap-oakleyglasses.us.com is www.replica-watches.com.co discovered www.nike.org.es immediately www.nikerosherun.us took the www.northfaceoutlet.com.co handkerchief www.tiffanyandco-canada.ca catch www.louis-vuitton-taschen.com.de Diushou www.ralph-laurenoutlet.ca Juan www.mcmhandbags.com.co people, www.mcm-handbags.org that www.rolexwatches-canada.ca Diushou www.tory-burchshoesoutlet.net Juan www.vans-schuhe.com.de will www.adidas-schuhe-online.de continue www.uggs.co.nl to www.louisvuitton-outlet.com.co lose, www.truereligion-outlet.com.co someone www.nike--freerun.co.uk who www.rayban-sunglasses.us.org can www.michael-kors-handbags.us.com back www.yoga-pants.net.co into www.true-religion.com.co place; www.ralphlauren-polos.co.uk catch, and throw www.montres-pascher.fr this www.ugg-uggboots.net man www.cheapjerseys.com.co who www.swarovski-australia.com.au has www.bottegaveneta-bagsoutlet.com sat www.rayban.com.de on www.thomas-sabos.org.uk the www.michael-kors-australia.com.au bit www.ugg-boots-australia.com.au when www.louisvuitton.jp.net this www.salomon-schuhe.com.de man www.abercrombie-fitchsale.com will www.beatsbydre.com.co be www.nikefree-run.net punished performances. www.jordan-shoes.com.co We www.nike-free-run.de will www.bottega-veneta.us.com play www.new-balance.ca along www.omega-watches.us.com with www.mcm-bags.in.net a www.oakley-sunglasses-canada.ca dozen www.michaelkors.so "Stars www.ugg-boots.ca over the www.maccosmetics.gr.com month www.the-north-face.ca child" www.ray-bansunglasses.net or www.pandora.com.de "cat www.pandorajewelry.top drilled www.yoga-pants.ca 72 www.michael-kors-outlet-online.us.org holes" www.giuseppezanotti.com.co game. www.tiffany-andco.com.au (Read www.pradahandbags.net.co the article www.edhardy.us.org Network: www.uggs-onsale.net www.sanwen.net)Also www.rayban.org.es I www.swarovski-crystal.us.com remember www.christianlouboutinoutlet.net.co one www.tocoachoutlet.com summer, www.christianlouboutinshoes.jp.net that www.nike-roshe-run.com.es the www.longchampoutlet.com.co acquisition www.lauren-ralph.co.uk of www.tnf-jackets.us.com medicinal www.michael-kors-outlet.us.org city www.ferragamo.com.co recovered www.weddingdressesuk.org.uk cicada www.hogan.com.de skin www.hollister.us.org (medical www.levisjeans.com.co term www.cheapuggboots.us.com called www.uhren-shop.com.de cicada), www.jordanretro.org catty www.hermes-outlet.com.co two www.replicarolex-watches.us.com five. www.toms-shoesoutlet.net So every day, www.cheap-baseballbats.net together www.adidas-superstar.nl with www.ralphlaurenoutletonline.in.net my www.ralphlaurenoutlet.us.com brothers www.mk-outlet.us.com holding www.zxcoachoutlet.com bamboo, www.oakley.org.es Dianzhe www.nikeair--max.fr plastic www.vans-shoes.net bags, www.fashionclothes.us.com and www.nike-airmaxinc.co.uk from www.adidas.org.es the www.moncler-outlet.us.org village www.cheapjerseys.us.org in www.thenorthface.com.de the www.louboutin.jp.net woods www.coachhandbags2016.us.com to www.nikestore.com.de find www.scarpe-hoganoutlets.it a www.cheap-michaelkors.com tree www.louisvuitton-outlets.us cicada www.jimmy-choos.com skin, www.hollisteronlineshop.com.de after www.cheapoakley-sunglasses.com the www.rolexwatchesforsale.us.com end www.prada.com.de of www.toms-shoes.com.co the www.guccishoes-uk.co.uk summer, www.coach-purseoutlet.net we www.longchamp-bags.us.com harvest www.longchamps.us.com relatively www.instylers.us.com big, www.coach-factory.in.net full www.ralphslauren-outlet.co.uk harvest www.valentino-shoesoutlet.us.com four www.adidas.com.se pounds, www.nike-shoes-canada.ca to www.oakley-outletstore.in.net buy www.raybans.us.org ten www.christian-louboutinshoes.com.co dollars. www.rosherun.org.uk The www.oakleyoutlet-online.us.com next www.toryburchoutlet-sale.us.com summer supra.shoesoutlet.us.com we www.canadagooses-2016.com look for www.coachoutlet-online.com.co a www.christianlouboutinshoesoutlet.org summer, www.ralph-lauren.com.au more www.swarovskicanada.ca than www.lululemoncanada.ca the www.tiffany-und-co.de first www.ralphlaurenonlineshop.de year www.michael--kors.us.com looking www.truereligionjeans.net.co for www.uggboots.com.de even www.louisvuitton.so more, www.celine-bags.org I www.uggsoutlet.com.co did not www.michaelkors-uk.org.uk expect www.nikeair-max.es there www.tiffany-andco.us.com to www.babyliss-pro.us.com happily www.michael-kors-canada-outlet.ca after www.nikemercurial.in.net being www.coco-chanels.us.com told www.bebeclothing.in.net not www.adidasshoes.top recovered. www.converse.com.de Cicada www.toms-outlets.us.com got www.michaelkorsbags.us.org hard www.barbour-jacketsoutlet.com skin, www.uggsaustralia.com.co back www.cheap-nike-shoes.net at www.nike-rosherun.nl home www.chi-flatiron.us.com after www.michael-kors.net.co shuffling, www.prada-handbags.com.co and www.replica-handbags.net.co www.the-northfacejackets.us.com
zyf543 · 110 weeks and 1 day ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: