How should I set up a server to map all subdomains of a domain to an IP?
I wish I could do something like that in the hosts
file:
127.0.0.1 *.example.com
How should I set up a server to map all subdomains of a domain to an IP?
I wish I could do something like that in the hosts
file:
127.0.0.1 *.example.com
As mailq mentioned, DNS supports wildcard host entries (while the hosts file does not).
A DNS record with the name
*
will match all names for which there is no other record on that name, returning the wildcard record.An entry would look like this:
But, I'm not sure why you'd want to do that pointing to 127.0.0.1 - can you clarify what you're attempting to accomplish with this, and we might be able to point you in a better direction?