District heating and cooling networks (DHCs) are complex thermal grids wherein a centrally heated/cooled fluid is circulated through a network of pipes and heat exchangers to meet the heating/cooling needs of residential and commercial buildings. Several factors can hinder efficiencies and impartial distribution of energy among customers in these networks. These include varying levels of building insulation, distance of individual buildings from the central energy source, and thermal losses in network pipes. Moreover, shortage of energy at the central energy source and extreme weather conditions can exacerbate these issues, leading to differing levels of thermal comfort and customer disgruntlement in the long run. In this paper, we propose and study a demand response scheme that attempts to ensure thermal fairness among end- use energy consumers in modern thermal grids. We develop optimization formulations based on thermodynamic models of DHCs, which determine optimal heat inflow/thermostat settings for individual buildings in order to achieve targeted thermal fairness across the network. Our experimental results using physics based models for DHC networks show that it is possible to achieve targeted thermal fairness based social welfare objectives in the DHC network by controlling network parameters such as mass flow rates of water to the consumer premises and the supply water temperature.