The most commonly used Arabic word for “dictionary” is qamous (قاموس). Some sources suggest it is derived from the root “q-m-s”, which supposedly means “rising water”. I think this verb was retro-fitted into the language to give an Arabic root to what is clearly a foreign word. For behind qamous, it is hard to miss the Greek Ὠκεανός (okeanus), which is the root of the English ocean and the French océan.
But how did it come to mean “dictionary” in Arabic? For that, blame Abu Tahir bin Ibrahim Majduddin al-Fairuzabadi, a 14th century Arab-Persian lexicographer who composed the most authoritative Arabic dictionary of his time. He named it Al-Qamous Al-Muheet, or “The Ocean”, by which he meant to suggest comprehensiveness. His dictionary was such a hit that over the centuries its name was genericised and qamous came to mean “a dictionary”.