You'd need a resolver that was provided by a foreign organization, preferably a non-profit, with no business interests in your country whatsoever, so that your government had nothing to threaten them with if they didn't comply with the order.
Such a resolver would also need to be the default shipped with at least one major browser, such that blocking it would essentially mean "turning off the internet" for some users.
Then the pressure would move to forcing browsers to use a different DNS resolver, and the game would continue.
So the real answer to governments requiring dns resolvers to censor results is to ... not use those resolvers. which is actually relatively easy to do. But most internet users don't even know what a dns resolver is, much less how to configure their browser to use a public resolver that isn't big enough to attract the attention of your government.