How to use "/etc/hosts" file as only DNS on Android?
Add allowed hosts to /etc/hosts and define these firewall rules to block any outgoing DNS queries on standard UDP port 53:

~# iptables -I OUTPUT -p udp --dport 53 -j REJECT


* May also use less rude DROP target in place of REJECT

To be on safe side also block TCP port:

~# iptables -I OUTPUT -p tcp --dport 53 -j REJECT


iptables is part of stock Android releases. You need to add these rules on every boot. Use init.d script or define init service: How to run an executable on boot?