ipset + iptables is your friend, it’s easy to do. For example, you should replace dnsmasq with dnsmasq-full via opkg update && opkg remove dnsmasq && opkg install dnsmasq-full.
Creat file /tmp/dnsmasq.d/whiltelist.dns, and add lines:
server=/google.com/127.0.0.1#53
ipset=/google.com/whitelist
Iptables rules:
iptables -t nat -I PREROUTING -m set ! --match-set whitelist dst -j DROP
iptables -t nat -I PREROUTING -m set --match-set whitelist dst -j ACCEPT
Just an example.