This survey was attempted to establish the fengshui knowledge system in the Chinese Middle Ages by investigating the Dunhuang Manuscripts of fengshui. Sixteen manuscripts of 30,000 words in total length were collected, excluding those concerning burial. From the contents of these sixteen, it could be found the presence of the wuxing zhai fa (五姓宅法 the Dwelling Method of the Five Surnames), prevailing during the Eastern Han and the Wei Dynasties, and the bazhai fa (八宅法 the Method of the Eight Dwellings) in embryo, which was to prevail in the Ming and the Qing Dynasties; as well as the combination of fengshui with the Daoist magic and rituals. These sixteen could only be roughly dated to the period between the ninth and the mid-eleventh centuries, thus presumed the time denoting the transition from the wuxing zhai fa to the bazhai fa. Those manuscripts concerning the wuxing zhai fa were probably derived from one source, and were complementary to one another. Part of their contents could be seen in the Congjiaozheng dili xinshu (重校正地理新書 the Revised New Book on Fengshui) of the Song Dynasty, and the Huangdi zhaijing (黃帝宅經 the Yellow Emperor’s Dwelling Classics) of pending date. The written contents of the wuxing zhai fa, as shown in these manuscripts, include the phonetic definition of the Five Surnames, the good/bad luck judgment of land form, the directional priority of building dwelling units and the method to move between them, as well as relative building taboos; and the illustrated contents of which showed that for each of the Five Surnames there were two kinds of dwelling charts: one was the zhaidi tu (宅地圖 the Chart of the Dwelling Plot), whose good/ bad luck judgment was based on the allocation of the ershisi fangwei (二十四方位the Twenty-four Points) to the shi’er shen (十二神the Twelve Spirits) ; the other was the zhai tu (宅圖 the Chart of the Dwelling), whose good/ bad luck judgment was based on the allocation of the ershisi fangwei to the Jianchu shi’er shen (建除十二神 the Twelve Jianchu Spirits) and the shi’er yuejiang (十二月將the Generals of the Twelve Months). In the end, a third chart appeared, called the yinyang wuxing zhaitu tongkan yongzhi (陰陽五姓宅圖同看用之 To Be Consulted for the Dwelling Charts of Yin and Yang and the Five Surnames), which combined the zhaidi tu and the zhai tu together with the simen (四門 the Four Doors) and the bakou zhijia (八口之家 the family of eight members), and should be where the yinyang zhaitu (陰陽宅圖 the Yin and Yang Dwelling Charts) in the Hangdi zhaijing were derived. These charts were presented with a square framework, similar to what could be found in the books of astronomy, calendar and divination of the Tang and the Song Dynasties. This square framework should be derived from the shi pan (式盤 the Shi board) of the ancient time, and was full of the implication of the wuxing (五行the Five Elements), the jiugong (九宮 the Nine Palaces) and the shi’er du (十二度the Twelve Points). This square made it easier to integrate the manipulation of spatial and temporal systems, and could also imply the concept of the center. On the whole, the Dunhuang manuscripts of fengshui were roughly representative of the fengshui knowledge of the Late Tang, through the Five Dynasties, to the Song, which inherited the land selecting manipulation of the wuxing (五姓the Five Surnames) of the Eastern Han onwards, and heralded the manipulation of the bazhai (八宅the Eight Dwellings), in prevalence in the Ming and the Qing, thus had played a transitional role in fengshui history and was also important in the clarification of the fengshui knowledge in the Chinese Middle Ages.