How can I set up a catch-all (wildcard) subdomain?

wildcard DNS record is a record that will match requests for non-existent subdomains. A wildcard DNS record is specified by using a “*” as the part of a domain name, e.g., *.example.com.