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.0.0.1
Create a configuration to map the wildcard subdomains to the same IP. Restart the service. Create /etc/resolver directory. Create a custom DNS resolver where the file name is the domain name.
1 Answer. Usually /etc/hosts file doesn't support any wild card entries.
It happens that /etc/hosts
file doesn't support wild card entries.
You'll have to use other services like dnsmasq. To enable it in dnsmasq, just edit dnsmasq.conf
and add the following line:
address=/example.com/127.0.0.1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With