(CNN) Democratic presidential candidate Pete Buttigieg used a Fox News town hall in New Hampshire on Sunday to slam two of the network's primetime opinion hosts, knocking both Tucker Carlson and Laura Ingraham by name on the network where they each host an hour.

The moment came when the South Bend, Indiana, mayor was trying to explain why he agreed to do a town hall with Fox News, something that other Democrats -- namely Massachusetts Sen. Elizabeth Warren -- have said they would not do because of the network's near constant attacks against the party, and, as Warren said, because the network has mixed "bigotry, racism, and outright lies with enough legit journalism to make the claim to advertisers that it's a reputable news outlet."

"There is a reason why anyone has to swallow hard and think twice about participating in this media ecosystem," Buttigieg said after hitting Carlson for saying immigrants make the country dirty and Ingraham comparing detention centers with children to summer camps.

"Even though some of those hosts are not there in good faith, I think a lot of people tune into this network who do it in good faith," he said, adding that Democrats "can't blame" Fox viewers if "they are ignoring our message because they will never hear it if we don't go on and talk about it."

A spokeswoman for Fox News did not respond to CNN's request for comment.

Read More