Whole blood stimulation assay (WBA) with killed gram-positive and gram-negative udder pathogens were used to investigate the interference of the endotoxin-binding antibiotic polymyxin B (PMB) on the ex vivo TNF-α response. Blood samples were collected from first to third lactating dairy cows in their early lactation (<50 days in milk, n = 32) period. The WBA was stimulated with both inactivated bacteria (e.g., dead Escherichia coli, Staphylococcus aureus, Streptococcus dysgalactiae, Streptococcus uberis), at a concentration of 2.5 × 106/mL; and pathogen-associated molecular pattern molecules, namely E. coli LPS (10 μg/mL), and S. aureus peptidoglycan (PG, 10 μg/mL). The PMB was added at a concentration of 0, 12.5, 25, 50, 100, and 200 μg/mL to each stimulant, respectively. All bacteria stimulants resulted in an increased TNF-α response compared to the negative control. The PMB affected the TNF-α responses of gram-positive (except S. dysgalactaie), gram-negative bacteria; and bacterial cell wall components at a PMB concentration of 25–50 μg/mL. The LPS and E. coli had similar TNF-α response but PG had a lower TNF-α response than gram-positive bacteria. The doses of PMB (≥ 25 μg/mL) should be used with caution when using different types of pathogens or should be avoided in ex vivo TNF-α studies.