WordPress MU: DNS Wildcards

To enable a subdomain type of installation in WordPress MU, you’ll need a wildcard entry in the DNS. The following instructions applies only to Dreamhost users, but they can be easily adapted to other CPanels or other host providers.

Steps

  1. Login to the Dreamhost’s Panel
  2. Click on the Manage Domains
  3. Find yourdomain.com and click the DNS link
  4. Add a custom DNS to yourdomain.com. See entry below
  5. Click “Add Record Now” submit button

Custom DNS Entry
Name: *
Type: CNAME
Value: yourdomain.com.
Comment: wildcard dns script

Captured Images

dnswildcards1.png

dnswildcards2.png

If your provider does not provide you with the facility to add DNS records, please contact the support team telling them you need a wildcard entry in the DNS for a particular domain. They are usually happy to enter it for you. Please note some providers don’t allow wildcard entries, then you are better off using a subdirectory structure or moving to another host provider that supports it.

You literally do not need to add subdomains to yourdomain.com when installing WordPress MU. I made that mistake. The DNS wildcard and Apache’s mod_rewrite module should do the trick for you. As long as you have those two requirements, the subdomain type of install of WordPress MU will work.

  • Twitter
  • Facebook
  • Google Plus
  • Pinterest
  • PDF
  • RSS

25 Comments

  • At 2007.07.12 07:43, Alen said:

    What about that part of adding code to httpd.conf?
    I guess it might not be needed. I have done this, but all I get for all sub domains is cPanel page confirming that is installed.

    What should .htaccess look like, could you c/p?

    • At 2007.07.12 09:36, ulyssesr said:

      Alen,

      There’s no need to add code in httpd.conf when using DNS wildcards for WordPress MU. I made an entry earlier about .htacess and WordPress MU. Just search ‘.htacess’ on this website and that should give you the correct .htaccess. Let me know how it goes.

      • At 2007.07.12 12:58, Alen said:

        Still no go…
        My .htaccess was almost same, just added redirection for www
        and 2nd line was “RewriteBase BASE/” – just deleted BASE part, everything else was same.

        I’m using WHM / cPanel, but it should not be much different.
        I have installed new WordPress MU in root folder and created few blogs for test i.e.
        http://test.webmajstori.org/ but it just shows cPanel page…

        Am I missing something in DNS setting:
        http://webmajstori.org/temp/dns.gif

        I have also tried as instructed in other tutorials but with same results:
        * 14400 A 85.94.76.38
        (http://www.blogopreneur.com/2006/11/06/installing-wordpress-mu-on-a-cpanelwhm-server/)

        It appears like it’s htaccess problem, because wildcard sub domains are “working” :-/

        • At 2007.07.12 16:34, ulyssesr said:

          Alen,

          Unfortunately, I don’t have WHM cPanel like yourself. I’m with Dreamhost. In your entry detailed in the gif you provided, you have the fully qualified domain entered as ‘*.webmastori.org.’ Have you tried entering just the asterisk, “*” to see if that will work? In my WordPress MU setup, I never had to do anything with the httpd.conf file, unlike what blogopreneur.com wrote. My setup is just a little different since I dont use cPanel. Also, make sure .htaccess is writable. Chmod .htaccess to either 755 or 777.

          • At 2007.07.27 12:15, Steven said:

            how about if you want individual authors to have a profile page with myspace-like structure –
            e.g. site.com/mypage

            • At 2007.07.27 13:13, Alen said:

              That is easy to set up from WP MU, no need for any special server side interventions.

              p.s.
              I have managed to set it up only after host has added an unique IP address for my site :)

              • [...] ulyssesonline.com » WordPress MU: DNS Wildcards » Blog Archive – For WordPress MU [...]

                • At 2007.12.17 20:38, brandon said:

                  For a stable wildcard on Dreamhost, you have to have support do it. I’m a Dreamhost customer, and as a best practice, Dreamhost users have to ask for a wildcard DNS Any Dreamhost user will save themselves a lot of trouble down the road if they have it done this way, since using the panel will either cause a series of redirects that won’t complete, or use a lot of CPU. The only way I see this technique working is with a unique IP.

                  The proper, trusted instructions for installing MU on Dreamhost are here http://wiki.dreamhost.com/WordPress_MU. It’s just easier and saves trouble down the line.

                  • At 2008.06.22 08:38, Michael E-O said:

                    I’ve noticed some installation instructions use Type: A instead of Type: CNAME – I’m a little unfamiliar with DNS… any ideas why some people choose Type: A over Type: CNAME?

                    • At 2008.06.22 08:58, ulyssesr said:

                      An A record is usually a hostname entry in the DNS, while a CNAME (canonical name) is usually an alias entry.

                      • At 2009.05.04 20:40, Arnon said:

                        Thank you so much. This article can help me.

                        • At 2009.06.20 21:41, Chema said:

                          Hello,

                          Only with the dns wildcard is enough?

                          I’m not installing WP MU, but I’m doing a software (open-classifieds.com), and I want to turn it multi domain, the thing is, I already add the wildcard, but I don’t need to say somehow to the apache that needs to handle that xx.myserver.com?

                          Thanks

                          • At 2009.07.01 09:18, see request variables said:

                            Do you want know your tools and utils for webmaster?

                            • At 2009.07.01 11:04, DNS lookup tools said:

                              Cool servise – My-Addr Project

                              • At 2009.07.05 08:08, mweeza said:

                                Finally found the info I needed thanks to your great blog, thanks! ^^

                                • At 2009.10.21 14:57, web hosting said:

                                  Hey, you must see it – web hosting

                                  • At 2009.12.05 03:38, charan said:

                                    Hi..
                                    i am using wordpress mu 2.8.4 and i have around 200 sub blogs in it.
                                    my client wants to change the url of each blog to specific url.
                                    Ex: http://myblog.com/blog1 to http://anotherblog.com. My client already registered 200 domains and all the domains are pointing to main site.

                                    How can i mask the url of each blog. please help me…

                                    thanks
                                    regards

                                    • At 2009.12.06 12:10, ulyssesr said:

                                      Hi Charan,
                                      WordPress.com has a feature that allows users to have their own domains. You need something similar to the WordPress.com does it. I’m not really sure how they do it. It’s probably using a DNS or .htaccess or the combination of the two. I haven’t tried it so I can’t really help you out, but others might be able to help you.

                                      • At 2010.01.16 08:23, real madrid said:

                                        I receive a 404 error or no input file when accessing my subdomains. :(

                                        • At 2010.01.16 15:44, ulyssesr said:

                                          It’s one of two things, either your dns entries are not working or your rewrite rules are not working in .htaccess.

                                          • At 2010.01.25 18:18, dralezero said:

                                            Get the “Domain Mapping” plugin from wordpress.org. It will let you have unique domains for blogs under the MU. Then I believe you can create a CNAME. I haven’t done the CNAME route, as Dreamhost makes it easy to point a domain to a site by their Mirror Feature.

                                            • At 2010.01.27 13:25, ulyssesr said:

                                              I got to try this plugin, although I’m no longer with Dreamhost.

                                              • At 2010.09.24 22:36, Blogger Mojokerto said:

                                                about custom dns are its under zone record edit?
                                                because i wanna make WPMU site for my friends
                                                Its The Site Blogger Mojokerto

                                                • At 2010.09.27 12:08, Ulysses said:

                                                  I have a WP-MU site as well, but I’m using directories. I had a WP-Mu site working with subdomains for a while, but I’m no longer running it, but I posted this a while back about DNS wildcards.

                                                  • [...] to 1.1.1.1 you will need to setup a wildcard dns entry in your Dreamhost panel. Have a look at this blog which give some advice on how to do just [...]