Exogenous molecules derived from catabolic states (e.g., fatty acids, β-hydroxybutyrate) during periods of stress such as the periparturient period or pathogen challenges [e.g., lipopolysaccharide (LPS)] can trigger an inflammatory response in tissues such as the liver and the mammary gland. Butyrate is one of the major short-chain fatty acids produced in the rumen, and work with non-ruminants has demonstrated that it can alter inflammatory processes. The primary objective of this study was to explore the preventive effect of sodium butyrate (SB) on LPS-induced inflammation in bovine mammary epithelial cells along with underlying molecular mechanisms. Immortalized bovine mammary epithelial cells (MAC-T) were treated with SB (0.1, 0.25, 0.5, 1, 2, or 5 mM) or with the histone deacetylase inhibitor trichostatin A (TSA; 6.25, 12.5, 25, or 50 nM) for 18 h, followed by a challenge with 1 µg/mL LPS for an additional 6 h. Pretreatment with SB prevented increase in apoptosis of LPS-challenged MAC-T cells in a dose-dependent manner. The LPS treatment upregulated mRNA abundance of tumor necrosis factor α (TNFA), interleukin-6 (IL6), and interleukin-1B (IL1B), whereas inhibition of histone deacetylase with TSA dampened this effect. More importantly, SB had clear dose-dependent effects on the inflammatory response by preventing upregulation of TNFA, IL6, and IL1B. Furthermore, pretreatment with TSA or SB attenuated the downregulation of histone H3 acetylation protein abundance induced by LPS. The greater ratio of p-IκB α/IκB α and p-p65/p65 protein abundance and the increase in nuclear localization of NF-κB p65 protein in response to LPS were attenuated by pretreatment with SB. Overall, the data indicated that exogenous SB alleviates mammary cell pro-inflammatory responses partly through post-translational mechanisms that diminish NF-κB signaling. Thus, the cytoprotective effect of SB against an inflammatory challenge might represent a preventive tool to help the mammary gland against pathogens such as those causing mastitis.