How to Add a Wildcard DNS Record

Wildcard subdomains are useful to allow end users of a domain-based WordPress multisite network to create new sites on demand. In this type of network each new site has its own subdomain, and the wildcard configuration means that those subdomains do not have to be configured individually.

Apache:

In the httpd.conf file, or in the include file containing the VirtualHost section for your web account, add a line like this (if it is not already present):

ServerAlias *.example.com

Note: for cPanel based servers, the Apache httpd config file is located here:
/usr/local/apache/conf/httpd.conf

Also create a wildcard DNS record like:

*.example.com A 192.0.43.10

cPanel:

Make a sub-domain named “*” (wildcard) at your cPanel (*.example.com). Make sure to point this to the same folder location where your wp-config.php file is located.

Finally, to aid the management of the multisite (within WordPress), the following plugins will provide the needed functionality:

WordPress MU Domain Mapping:
https://wordpress.org/plugins/wordpress-mu-domain-mapping/

Multisite Plugin Manager:
https://wordpress.org/plugins/multisite-plugin-manager/

New Blog Defaults:
https://wordpress.org/plugins/wpmu-new-blog-defaults/

Multisite Enhancements:
https://wordpress.org/plugins/multisite-enhancements/

Leave a comment

BlogLogistics