# DICT dictionary server protocol

I have often found myself browsing the web just to look up some word
definition. This seems a terrible waste of resources just to find out
the meaning of a word, and then I remembered there is a protocol that
provides this. That protocol is DICT[1].

As with many protocols from the golden era of computing, it can be
utilized without a specialized client.


## Some examples

> $telnet dict.org 2628
> Trying 199.48.130.6...
> Connected to dict.org.
> Escape character is '^]'.

Type 'help'.

> help
> 113 help text follows
> DEFINE database word         -- look up word in database
> MATCH database strategy word -- match word in database using str..
> SHOW DB                      -- list all accessible databases
> SHOW DATABASES               -- list all accessible databases
> SHOW STRAT                   -- list available matching strategies
> SHOW STRATEGIES              -- list available matching strategies
> SHOW INFO database           -- provide information about the da..
> SHOW SERVER                  -- provide site-specific information
> OPTION MIME                  -- use MIME headers
> CLIENT info                  -- identify client to server
> AUTH user string             -- provide authentication information
> STATUS                       -- display timing information
> HELP                         -- display this help information
> QUIT                         -- terminate connection
>
> The following commands are unofficial server extensions for debu..
> only.  You may find them useful if you are using telnet as a cli..
> If you are writing a client, you MUST NOT use these commands, si..
> they won't be supported on any other server!
>
> D word                       -- DEFINE * word
> D database word              -- DEFINE database word
> M word                       -- MATCH * . word
> M strategy word              -- MATCH * strategy word
> M database strategy word     -- MATCH database strategy word
> S                            -- STATUS
> H                            -- HELP
> Q                            -- QUIT
> .
> 250 ok

To see a list of all available databases.

> show db
> 110 166 databases present
> gcide "The Collaborative International Dictionary of English v.0.48"
> wn "WordNet (r) 3.0 (2006)"
> moby-thesaurus "Moby Thesaurus II by Grady Ward, 1.0"
> elements "The Elements (07Nov00)"
> vera "V.E.R.A. -- Virtual Entity of Relevant Acronyms (February 2016)"
> jargon "The Jargon File (version 4.4.7, 29 Dec 2003)"
> foldoc "The Free On-line Dictionary of Computing (30 December 2018)"
> easton "Easton's 1897 Bible Dictionary"
> hitchcock "Hitchcock's Bible Names Dictionary (late 1800's)"
> bouvier "Bouvier's Law Dictionary, Revised 6th Ed (1856)"
> devil "The Devil's Dictionary (1881-1906)"
> world02 "CIA World Factbook 2002"
> gaz2k-counties "U.S. Gazetteer Counties (2000)"
> gaz2k-places "U.S. Gazetteer Places (2000)"
> gaz2k-zips "U.S. Gazetteer Zip Code Tabulation Areas (2000)"
> ...

To do a basic word search of all databases.

> d gopher

To do a word search of a specific database.

> d foldoc gopher
> 150 1 definitions retrieved
> 151 "gopher" foldoc "The Free On-line Dictionary of Computing (3..
> gopher
>
>    <networking, protocol> A {distributed} document retrieval sys..

If you want to script something or just use it from the command line
then you can do something like the following:

> $echo "d foldoc gopher" | nc -N dict.org 2628 | less


## Conclusion

There are many dictionaries available so this is a very useful
resource.

I thought about writing a gopher interface to DICT, but maybe it's
worth learning a bit about the protocol[2]. I may come back to it if
there is any interest...


## References

[1](gopher://gopherpedia.com:70/0/DICT)
[2](gopher://gopher.icu/0/files/rfc/rfc2229.txt)