HowTo – WordPress 3.0 Setting Up Wildcard DNS For Multisite Hosting

Filed under: Wordpress Tips

wordpress-logo

For users of WordPress that manage many domains the features of the WPMU (WordPress Multi-User) package are now part of the base version of WordPress 3.0 and above. This feature will allow you to host both sub.domains and with a plugin host completely different primary domains within the same WordPress install.

However in order to host sub-domains such as: sales.mysite.com or gallery.mysite.com you will need to let WordPress handle the redirects.

In some ways letting WordPress do the work is easier for administrators to manage because it does not require setting up each sub-domain and installing a new version of WordPress but if you are a commercial hosting business you may find that the WordPress Redirect method exposes the url of the primary account. This is fine if you are using sub-domain hosting to separate related content but may not be attractive to your customers if you are hosting sites with completely different content.

Setting Up Wildcard Domains

Most people who purchase shared hosting will have access to a cPanel hosting account manager for setting up add-on domains within their account. This is also the easiest way to setup Wildcard DNS for your WordPress 3.0 Multihosting site but don’t worry if you do not have cPanel you can still make the settings by editing your DNS records and Apache conf files.

If you are running a local test server on Windows XP or above you will not have the option to add a wildcard setting in your host file. Instead you will need to run your own DNS Server and setup a wildcard for the local domain. Alternatively you could probably get away with manually adding each subdomain in your host file and having them point to the same IP.  If you are attempting to do this you should not use the LocalHost 127.0.0.1 but try using an ip range for your  sub.domains using  the IPs 192.168.0.1 to 192.168.0.255.

For more information on Windows DNS desktop systems you may want to visit http://www.bind9.net/download

Server versions of Windows will allow you to add your own Wildcard DNS Setting. See this KB page on Microsoft’s Website http://support.microsoft.com/default.aspx?scid=kb;en-us;193844

cPanel Wildcard DNS Setup

Like we said most people will have access to cPanel or another control panel to setup their domains and manage their DNS Records.

In cPanel Login to your account and look for your subdomain control panel applet.

Your domain should be functioning and propagated before you attempt setting up a wildcard subdomain.

Now you want to add a subdomain that will point to the location of your WordPress 3.0 install choosing the directory with your .htaccess file as your target.

If you only have one domain and site on your account you can point to your base public_html directory.

Click Create and you are ready to add sub-domain hosting to your WordPress 3.0 Website.

Note: This method may not work for all hosting solutions that use cPanel but because it is the easiest way to add a wildcard domain it is probably the best way to get started.

If you have problems because you are hosting many addon domains  meaning many domain names with independent sites then you should make sure that the wildcard is pointing to the directory with WordPress 3.0 .

Remember you will need to go into WordPress and enable your Network Options after you add your wildcard.

For more help you can contact your hosting company, their support faq pages or go to cPanel’s website and review documentation.

Also if you are on a Single Domain minimal hosting account you may not have the DNS / Subdomain applet available to you in your cPanel account… they need to turn it on in the WHM manager.

If all else fails you should still be able to host multiple sites by using domain.com/subdirectory settings for your WordPress 3.0 network.

SubDirectory Hosting will always work if your host can support pretty urls or permalinks.

Additional Resources

For users of the Plesk Hosting Control Panel see our other HowTo on setting up your wildcard domains with Plesk.

HowTo – Setting Up WordPress 3.0 Multisite Hosting On Plesk