A Necronomicon would have been a compilation, by a medieval Arabian scholar, of cosmological knowledge that had otherwise been lost.
One source of this compilation would have most likely been the Pnakotic Manuscripts, a concept that was probably based upon the real lost book, Phoenician History by Sanchuniathon, c. 2000 BCE.
[
phoenicia.org]
The Necronomicon, however, doesn't have such a strongly obvious model in the real world. Perhaps it was inspired by many things, including John Dee's fanciful interpretaion about what the (at that time lost) Book of Enoch contained.