Drupal Multisite (subdomain) Not Working Drupal 6, default installation, default .htaccess, default http.conf for Apache. 

sites/ directory looked like this:

all
default
subdomain1.maindomain.com


default site and subdomain1 working well. 

Added a new directory, subdomain2.maindomain.com. It has the same ownership and permissions as subdomain1.maindomain.com. It contains default.settings.php, the out-of-the-box one, and settings.php, which is a copy of default.settings.php. The permissions and ownership of the two files are correct. 

The 'sites' directory now looks like this:

all
default
subdomain1.maindomain.com
subdomain2.maindomain.com


Visiting subdomain2.maindomain.com returns an error. Visiting subdomain2.maindomain.com/install.php returns an error. I can download an example file from  maindomain.com/sites/subdomain2.maindomain.com/files/example.txt when it is located at /sites/subdomain2.maindomain.com/files/example.txt. 

Basically, I've followed all the steps in the docs, and I'm unable to create another 'subsite' accessible from a new subdomain. What am I doing wrong? What else should I be doing?
If you want to run several sub-domains on the same code base you need to make sure that either both the sub-domains resolve to the same IP address as your main domain, or that your main domain supports wildcard DNS. You also might consider giving Subdomain module and Domain Access module a try.