dictd local dictionary server with thesaurus on Freebsd

Setting up the dictd server with dictionaries and a thesaurus on Freebsd

For the command line and Emacs

When i was about 8 my Granny gave a me a dictionary for Christmas

Naturally the first thing i did was search for mucky words
only to be disappointed to find it was the censored kids version

All these years later i can finally look them up

dict dictd dictionary server freebsd

resources

https://rockyhotas.github.io/freebsd/2026/04/12/freebsd-dictd.html

packages

Bash:
doas pkg install dict dictd bsdtar

enable dictd

Bash:
doas sysrc dictd_enable="YES"

or manually edit your rc.conf

Bash:
doas vi /etc/rc.conf

Code:
dictd_enable="YES"

create the dictd directory

Create the dictd directory

Bash:
doas mkdir -p /usr/local/share/dictd

config files

dict

Bash:
doas vi /usr/local/etc/dict.conf

Code:
#=========================================================================#
# This file is used to specify the dict servers to talk to.  See the
# CONFIGURATION section of dict(1) for the full syntax.
#
# A list of public dict servers is available at
#   https://dict-servers.catflap.org/
# but one of the following should work.
#
#=========================================================================#

server localhost
server dict.org
server dict.catflap.org
server dict.trit.net

dictd

Bash:
doas vi /usr/local/etc/dictd.conf

Code:
#=========================================================================#
# /usr/local/etc/dictd.conf
#=========================================================================#

global {
    listen_to 127.0.0.1
    port 2628
    pid_file "/var/run/dictd.pid"
}

database gcide {
    data "/usr/local/share/dictd/gcide.dict.dz"
    index "/usr/local/share/dictd/gcide.index"
}

database jargon {
    data "/usr/local/share/dictd/jargon.dict.dz"
    index "/usr/local/share/dictd/jargon.index"
}

database foldoc {
    data "/usr/local/share/dictd/foldoc.dict.dz"
    index "/usr/local/share/dictd/foldoc.index"
}

database wn {
    data "/usr/local/share/dictd/wn.dict.dz"
    index "/usr/local/share/dictd/wn.index"
}

database moby-thesaurus {
    data "/usr/local/share/dictd/moby-thesaurus.dict"
    index "/usr/local/share/dictd/moby-thesaurus.index"
}

dictionaries

create dict-files directory

Bash:
mkdir -p dict-files

Bash:
cd dict-files

gcide

https://ftp.debian.org/debian/pool/main/d/dict-gcide/

fetch the latest deb file

Bash:
fetch 'https://ftp.debian.org/debian/pool/main/d/dict-gcide/dict-gcide_0.48.5+nmu4_all.deb'

extract the file

Bash:
ar x dict-gcide_*.deb
tar -xf data.tar.*
doas mv usr/share/dictd/gcide.* /usr/local/share/dictd/

remove files and directory

Bash:
rm control.tar.xz data.tar.xz debian-binary

Bash:
rm -r usr

wordnet

https://ftp.debian.org/debian/pool/main/w/wordnet/

fetch the latest deb file

Bash:
fetch 'https://ftp.debian.org/debian/pool/main/w/wordnet/dict-wn_3.0-41_all.deb'

extract the file

Bash:
ar x dict-wn_*.deb
tar -xf data.tar.*
doas mv usr/share/dictd/wn.* /usr/local/share/dictd/

remove files and directory

Bash:
rm control.tar.xz data.tar.xz debian-binary

Bash:
rm -r usr

jargon

https://ftp.debian.org/debian/pool/main/d/dict-jargon/

fetch the latest deb file

Bash:
fetch 'https://ftp.debian.org/debian/pool/main/d/dict-jargon/dict-jargon_4.4.7-5_all.deb'

extract the file

Bash:
ar x dict-jargon_*.deb
tar -xf data.tar.*
doas mv usr/share/dictd/jargon.* /usr/local/share/dictd/

remove files and directory

Bash:
rm control.tar.xz data.tar.xz debian-binary

Bash:
rm -r usr

foldoc

https://ftp.debian.org/debian/pool/main/d/dict-foldoc/

Bash:
fetch 'https://ftp.debian.org/debian/pool/main/d/dict-foldoc/dict-foldoc_20250211-1_all.deb'

extract the file

Bash:
ar x dict-foldoc_*.deb
tar -xf data.tar.*
doas mv usr/share/dictd/foldoc.* /usr/local/share/dictd/

remove files and directory

Bash:
rm control.tar.xz data.tar.xz debian-binary

Bash:
rm -r usr

dict-moby-thesaurus

https://aur.archlinux.org/packages/dict-moby-thesaurus

Bash:
fetch 'https://github.com/ferdnyc/dictd-dicts/raw/master/moby-thesaurus.dict'

Bash:
fetch 'https://github.com/ferdnyc/dictd-dicts/raw/master/moby-thesaurus.index'

Bash:
doas cp moby-thesaurus.* /usr/local/share/dictd/

change permissions

Chown the directory

Bash:
doas chown -R nobody:nobody /usr/local/share/dictd

Chmod the files

Bash:
doas chmod 644 /usr/local/share/dictd/*

start dictd

Bash:
doas service dictd start

dict query

query dict running on localhost

Bash:
dict -h localhost idea

query a database

Bash:
dict -h localhost -d gcide idea
dict -h localhost -d wn idea

list databases

Bash:
dict -h localhost -D

Code:
gcide          The Collaborative International Dictionary of English v.0.48
jargon         The Jargon File (version 4.4.7, 29 Dec 2003)
foldoc         The Free On-line Dictionary of Computing (11 February 2025)
wn             WordNet (r) 3.0 (2006)
moby-thesaurus Moby Thesaurus II by Grady Ward, 1.0

emacs init.el

Code:
~/.config/emacs/init.el

Code:
(setq dictionary-server "localhost")
 
Back
Top