use dnsmasq
pretending you're using a debian-based dist(ubuntu,mint..), check if it's installed with
(sudo) systemctl status dnsmasq
If it is just disabled start it with
(sudo) systemctl start dnsmasq
If you have to install it, write
(sudo) apt-get install dnsmasq
To define domains to resolve edit /etc/dnsmasq.conf
like this
address=/example.com/127.0.0.1
to resolve *.example.com
! You need to reload dnsmasq to take effect for the changes !
systemctl reload dnsmasq