I recently wanted to point all subdomains for a test domain, let\'s say example.com to the localhost. Is there a way to point all requests on *.example.com to resolve to 127
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