Any way to block all DNS queries and whitelist some?

So, can this be used to block all domains and whitelist a couple?