Dairy production is a significant contributor to food security; however, it also causes environmental problems such as greenhouse gas emissions, water pollution, and land degradation. Pakistan, a country highly vulnerable to climate change, relies heavily on its dairy sector. This sector largely consists of small farms where sustainability practices may be limited. Understanding the economic and environmental impacts of these practices on Pakistan's rural and peri-urban dairy farms is critical, yet research in this area remains scarce. This study analyzes the economic and environmental sustainability of Pakistani dairy production in rural and peri-urban areas, considering farm structure, market factors, technical efficiency, and associated policy challenges. Data from 100 farms near Lahore were analyzed using farm budgeting, Data Envelopment Analysis (DEA), and truncated regression. Results indicate that Pakistani dairy production faces limited profitability, driven largely by feed costs. Rural farms showed higher profit margins, often due to lower input costs, but were generally less technically efficient. This low efficiency carries potential environmental consequences. Truncated regression revealed that education, experience, and family size have a significant influence on technical efficiency. Findings suggest the need for targeted interventions, such as extension services tailored to the needs of rural and peri-urban farmers, promoting improved feed practices, and supporting the adoption of sustainable technologies, to enhance the economic viability and environmental sustainability of Pakistan's dairy sector.