The Old History of the Tang (Jiu Tangshu 舊唐書) was compiled in the mid-tenth century and presented to the emperor in 945.
It contains two sections that provide information about the history of Linyi.
There is an account of Linyi in a section on foreign kingdoms, and there is information about Linyi in a section on the administrative units in the Annan Superior Prefecture (Annan fu 安南府), that is, the area that the Tang controlled in what is now Vietnam.
Here are translations of both of those sections. First is the account of Linyi in the section on foreign kingdoms.
(舊唐書/列傳 凡一百五十卷/卷一百九十七 列傳第一百四十七 南蠻 西南蠻/林邑國)
林邑國,漢日南象林之地,在交州南千餘里。其國延袤數千里,北與驩州接。地氣冬溫,不識冰雪,常多霧雨。其王所居城,立木為柵。王著白㲲古貝,斜絡膊,繞腰,上加真珠金鎖,以為瓔珞,卷髮而戴花。夫人服朝霞古貝以為短裙,首戴金花,身飾以金鎖真珠瓔珞。王之侍衞,有兵五千人,能用弩及䂎,以藤為甲,以竹為弓,乘象而戰。王出則列象千頭,馬四百匹,分為前後。其人拳髮色黑,俗皆徒跣,得麝香以塗身,一日之中,再塗再洗。拜謁皆合掌頓顙。嫁娶之法,得取同姓。俗有文字,尤信佛法,人多出家。父母死,子則剔髮而哭,以棺盛屍,積柴燔柩,收其灰,藏於金瓶,送之水中。俗以二月為歲首,稻歲再熟。自此以南,草木冬榮,四時皆食生菜,以檳榔汁為酒。有結遼鳥,能解人語。
The Kingdom of Linyi is the land of Xianglin [District] in the Han dynasty’s Rinan [Commandery]. It is located more than one thousand leagues south of Jiaozhou. The kingdom extends for several thousand leagues and borders Huanzhou to the north.
The climate is warm in winter; they do not know ice or snow, and there is often much fog and rain.
The city where the king resides uses standing timber to make palisades [note: The earlier Tongdian mentioned brick walls].
The king wears fine white cotton [baidie 白㲲] gubei 古貝 [cloth]. He wraps it diagonally across his arm and around his waist. Over this, he adds genuine pearls and gold chains to serve as tassels. He has curly hair and wears flowers. His wife wears dawn cloud [zhaoxia 朝霞] gubei [cloth] to make a short skirt. On her head she wears gold flowers, and her body is adorned with gold chains, genuine pearls, and tassels.
The king’s personal guard consists of five thousand soldiers. They are skilled in using crossbows and lances. They use rattan to make armor and bamboo for bows. They ride elephants to fight. When the king goes out, he lines up one thousand elephants and four hundred horses, divided into front and rear [vanguards].
The people have curly hair and black skin. The custom is that they all go barefoot. They obtain musk to smear on their bodies; within a single day, they smear and wash twice. When paying respects, they join their palms and tap their foreheads.
Regarding the laws of marriage, they are permitted to take those of the same surname.
The custom is that they have a writing system. They particularly believe in the Buddha dharma [Fofa 佛法], and many people leave the household life [to become monks].
When parents die, the sons shave their hair and weep. They place the corpse in a coffin, pile up firewood, and burn the bier. They collect the ashes, store them in a gold vase, and send them into the water.
The custom is to consider the second month as the beginning of the year. Rice ripens twice a year. From here to the south, the grass and trees flourish in winter. Throughout the four seasons, they eat raw vegetables. They use betel juice to make wine.
There are Jieliao 結遼 birds, which can understand human speech.
And here is the passage in the section on the administrative units in Annan Superior Prefecture. Discussion of Linyi appears in relation to a place called Lin Prefecture (Linzhou 林州).
(舊唐書/志 凡三十卷/卷四十一志第二十一地理四/十道郡國四/嶺南道/安南府/林州)
林州,隋林邑郡。貞觀九年,綏懷 林邑 置林州,寄治於驩州南界,今廢無名,領縣三,無戶口。去京師一萬二千里。
林邑,州所治。漢武帝開百越,於交趾郡南三千里置日南郡,領縣四,治於朱吾。其 林邑 ,即日南郡之象林縣。縣在南,故曰日南,郡南界四百里。後漢時,中原喪亂,象林縣人區連殺縣令,自稱 林邑 王。後有范熊者,代區連,相傳累世,遂為 林邑 國。其地皆開北戶以向日。晉武時,范氏入貢。東晉末,范攻陷日南郡,告交州刺史朱蕃,求以日南郡北界橫山為界。其後,又陷九真郡。自是,屢寇交趾南界。至貞觀中,其主修職貢,乃於驩州南僑置 林邑 郡以羈縻之,非正 林邑 國。
金龍,隋文帝時,遣大將劉方率兵萬人,自交趾南伐 林邑國,敗之。其王梵志遁走,方收其廟主一十八人,皆鑄金為之。方盡虜其人,空其地,乃班師。因方得其龍,乃為縣名。
海界,三縣並貞觀九年置。
Linzhou [Lin Prefecture]: It was the Linyi Commandery of the Sui dynasty.
In the ninth year of Zhenguan [635 AD], in order to appease and cherish Linyi, Linzhou was established. A temporary adminisration [jizhi 寄治] was established at the southern border of Huanzhou. It is now abolished and has no name. It led three counties and had no [registered] households or population. It is twelve thousand leagues from the Capital.
Linyi: It was the seat of the prefecture. Emperor Wu of Han opened up the territory of the Baiyue and established Rinan Commandery three thousand leagues south of Jiaozhi Commandery. It led four counties, with the seat at Zhuwu.
That Linyi is exactly Xianglin District of Rinan Commandery. The district is in the south, hence it is called Rinan [south of the sun]. It is four hundred leagues from the southern border of the commandery.
At the end of the Later Han dynasty, during the chaos of the Central Plains, a man from Xianglin District named Ou/Qu Lian killed the district magistrate and called himself the King of Linyi. Later, there was one Fan Xiong who replaced Ou Lian. It was passed down for generations, eventually becoming the Kingdom of Linyi. Their territory all opens windows on the north side to face the sun.
During the time of Emperor Wu of Jin, the Fan clan entered to offer tribute. At the end of the Eastern Jin, Fan attacked and captured Rinan Commandery. He notified Zhu Fan, the regional inspector of Jiaozhou, demanding that the /Hoành mountains on the northern border of Rinan Commandery be established as the boundary. Afterward, he also captured Jiuzhen Commandery. From then on, they frequently raided the southern border of Jiaozhi.
During the Zhenguan era [627–649 AD], their lord cultivated his official duties and tribute. Therefore, [the Tang] established a relocated [qiaozhi 僑置] Linyi Commandery south of Huanzhou to control them with loose reins [jimi 羈縻]; it is not the true Kingdom of Linyi.
Jinlong [District]: During the time of Emperor Wen of Sui, he sent the General-in-chief Liu Fang to lead ten thousand troops to attack the Kingdom of Linyi from the south of Jiaozhi, defeating them. Their King, Fanzhi, fled. [Liu] Fang collected eighteen of their temple tablets, all cast from gold. Fang captured all the people, emptied the land, and then withdrew his troops. Because Fang obtained their “dragons” [referring to the gold statues], this was used as the name of the district.
Haijie: These three counties were all established in the ninth year of Zhenguan.