Triacylglycerol (TAG) homeostasis is an integral part of normal physiology and essential for proper energy metabolism. Here we show that the single Drosophila ortholog of the PXR and CAR nuclear receptors, DHR96, plays an essential role in TAG homeostasis. DHR96 mutants are sensitive to starvation, have reduced levels of TAG in the fat body and midgut, and are resistant to diet-induced obesity, while DHR96 overexpression leads to starvation resistance and increased TAG levels. We show that DHR96 function is required in the midgut for the breakdown of dietary fat and that it exerts this effect through the CG5932 gastric lipase, which is essential for TAG homeostasis. This study provides insights into the regulation of dietary fat metabolism in Drosophila and demonstrates that the regulation of lipid metabolism is an ancestral function of the PXR/CAR/DHR96 nuclear receptor subfamily.