For this we will add a wild card in hositng like this (*.maindomain.com) for apache server,
But you are using IIS and IIS server does not support wildcards. To resolve this problem, You have to bind main Wordpress site in IIS. You need to add only one subdomain for the multi-sites, that is add subdomain and specify the same IP address of main site to this subdomain. Then All the multi-sites of main domain will get bind to this new created subdomain. Now your subsites will work.
Like This:
You must add an additional website in IIS 7 named eg. (subdomain.main.com)
- Sites> Add Website
- Site Name: subdomain.main.com
- Physical Path: select the subdomain directory
- Binding: same ip as main.com
- Host name: subdomain.main.com