At a DNS technical level, sure you can have:
*.example.com. IN CNAME example.com.
Although a better configuration would be:
@ IN SOA ( ... )
IN A n.n.n.n ; put your server IP here
www IN A n.n.n.n ; and here
* IN CNAME www
That will ensure that people doing a lookup for the
MX records of
foo.example.com don't get an unexpected answer.
However if your web server isn't set up to expect the wildcarded host names that people start using to point at, they'll just get error pages.
For that to work you need something like:
and that has to be in the main config, not in a