The landscape of traditional villages reflects specific geographical and cultural environments, with distinct regional cultural and living space characteristics. An exploration of the deep genetic core of traditional villages from the perspective of “cultural landscape genes” can help reveal the mechanism of historical evolution of regional settlements and provide a reference for maintaining the regional characteristics of traditional villages today. This study focuses on 23 nationally recognized traditional villages along the northern roads of the ancient Qin-Shu roads. The “landscape-gene” theory, centred on both artificial construction and cultural inheritance in traditional villages, was used to develop a method for identifying and extracting the northern roads of the ancient Qin-Shu roads landscape genes in “architecture culture”. Then, a genome of the cultural landscape of traditional villages was constructed. Six different dimensions with identified genes, including environmental layout, landscape, architectural landscape, material culture, behavioural culture and mentality culture, were analysed. The results showed the following: (1) the traditional villages on the northern roads of the ancient Qin–Shu roads have 8 genes in the constructed landscape, including ‘location layout mainly along mountains and ancient roads, supplemented by water and pictographic patterns’, ‘orderly, flexible and changeable spatial form’, ‘natural landscape surrounded by mountains and rivers, culture and scenery blend’, ‘water in the south and drought in the north’, ‘agricultural main forest auxiliary production landscape’, ‘single north section, complex south section courtyard layout’, ‘load-bearing diversity, good utilization of the gable building structure’, ‘combination of earth, stone and bamboo, recycled and reused building materials’ and ‘atmospheric regularity, exquisite and gorgeous building decoration’. (2) There were six cultural landscape genes, such as ‘strong personalities and regional customs’, ‘preference for flavourful and spicy foods, wine and meat’, which characterized material culture. ‘Romantic history and thrifty values’, and a ‘combination of elegance and vulgarity’ characterized behavioural culture. The mentality of the region was characterized by ‘Xiangtu and Shengxing’, ‘open and inclusive values’, and ‘varied’ beliefs. (3) Philosophical and cosmological underpinnings such as the ‘unity of heaven and humanity’ and the ‘yin-yang and five-element’ theory guide human settlements in traditional villages along the northern roads. This study aims to clarify the characteristics of cultural landscapes in traditional villages through the analysis of cultural landscape genes and a resulting mapped genome, which will provide a scientific basis for the sustainable development of cultural landscapes in traditional villages. Cultural genes can protect the inheritance of regional culture and provide a new perspective for the study of traditional villages along linear cultural heritage zones.