WordPress Multisite Networks and Wildcard Sub-Domains
There is a lot of confusion over how to correctly setup WordPress Multisite Networks, not least with getting them configured correctly using wildcard sub-domains.
What is a Wildcard sub-domain?
A wildcard allows for a subdomain of any name without having to specify each one, this is particularly useful for a WordPress Multisite Network – you can allow users to create their own sites on subdomains without worrying about changing the DNS / Host settings in your control panel.
Unfortunately, not all hosting providers support Wildcard’s so you may need to check this first before you continue – but most of the big boys- -Enom, Reg123 etc do.
The general rule is to setup a record that points to your server ip using an asterisk ( * ) instead of a name.
For example, your Host record might be:
* A 22.214.171.124
A common mistake in CPanel is to change the host record as above. CPanel requires a slightly different approach – you must create a new subdomain using an asterisk ( * ).
Note that if you already have a wildcard A record on your CPanel, this will cause errors and must be removed in order for you to create a wildcard subdomain.
What if my name servers are pointing elsewhere?
If your name servers are not pointing to your server and are being managed elsewhere, at Enom for example then you can simply combine these two techniques. Ensure that you have created a wildcard A record on your Providers’ DNS and also ensure that you create a wildcard subdomain on CPanel and you should be good to go!