Weakening demand for livestock and dairy produce, historically high prices for feed ingredients and increasingly strict regulations on animal waste management continue to put significant pressure on livestock and dairy operating margins. In this paper, we use representative farm mathematical programming models to analyze important linkages between farm management adjustments and changes in farm income due to recent changes in relevant agricultural prices and restrictions on land application of nutrients. We account explicitly for new restrictions on land application of nitrogen and phosphorus, and specifically applied to confined animal feeding operations (CAFOs). Our mathematical methods and the distinctive data available allows for the assessment of the effects on income and environmental nutrient loading for New York State dairy production farms. The results suggest that with current relative prices for feed ingredients, adjustments to dairy rations lead to increased nitrogen and phosphorus content in dairy waste and soil nutrient levels being applied well in excess of crop requirements. While the regulations will correct for this problem at the farm level, our results indicate that CAFOs could experience significant losses in income. These losses depend critically on the cost of off-site manure disposal. Our results also demonstrate that significant risks of excess nutrient loading remain during extreme weather events.