There is a specific entry in DNS zone called "wildcard DNS" which is configured as "*.domain.com" format. It's popularly used by most big websites that may produce lots of child sites. How wildcard DNS work and what would be its pros and cons? This article provides a list of comparison and explanation.
How to use wildcard DNS? It's nothing but a simple dns record of your domain name. The initial purpose is to redirect any non-existent sub domain name to your main site. It's normally setup as default by your domain dns provider. However, in order to let this entry work as expected, you need a dedicated IP for your domain and configure "*.domain.com" DNS A record to this dedicated IP address. Once done, whenever people request any non-existent sub domain they will be brought your your main website.
Pros of Wildcard DNS
Save website visitor. Just think you have a sub domain name called "boys.website.com" with all related topics on this site. But website users might mistype the site address to "boy.website.com". If there's no wildcard dns configured for this domain then people will get page not found error. Based user experience analysis, most people will just close the window unless they really have to logon your site. On the other hand, if you have wildcard dns setup with proper guidance on main site, visitors will get what they needed with no tricks to play with.
Fast website setup. Wildcard dns is widely used because it provides fast solutions for website deployment. For those big websites like wordpress.com, there's huge daily or hourly registration. What we experienced is you will get a new site ready in seconds as long as the name is not being used. The process is 100% automatic with no manual audit. It's all the effort by wildcard dns record. If we setup those sub domain names manually one by one, not to mention the needed man power, there's at least 30 minutes for DNS propagation, means people have to wait at least half an hour to work with their sites. It's absolutely not acceptable.
SEO practice. Under some circumstance, sub domain names perform better than sub directories. Especially you have a specific topic to work with, a sub domain will gain better search engine weight. Sub domain is considered different site from main site so you can easily create different contents under multiple sub domain sites then link back to main site for link building purpose. From the early times, multiple sub domain ability is one of SEO rules over a site. By wildcard dns, you got the ability to create unlimited sub domains as long as your server is allowed.
Cons of Wildcard DNS
Regardless of above advantages of wildcard dns, it always brings problems to people. The typical issue is DNS hacking. See below for example and solutions.
Recently one of our friends' website got punised by search engie. However, this site has been doing well and strictly followed the google optimization guidelines. There's not a single incorrect onsite or offsite operation as he can tell. Finally, we I do "site:domain.com" from google bar, it returns lots of unrelated topics under some sub domains he's not awared of for example "porn.oo.domain.com" or "casino.oo.domain.com" or any other illegal contents. From DNS checking, a wildcard dns is added for that domain and pointed to an IP address he did not know of. Undoubtedly, someone hacked into his DNS server or domain account to make the change.
So what's the solution and how to prevent such issue happening again? The simple solution is to remove the wildcard DNS and probably disable this service if possible. However, you have to work harder in order to recover from search engine punishment. Sometimes you can do nothing but to change for a new domain. Here're some tips on how to avoid your domain wildcard dns to be abused.
Get a safe dns provider. It's not new to hear about dns server being hacked nowadays. You must find a good dns service to configure your domain name. Urgent recovery service should be provided in case there's any unauthorized change in your dns file.
Tighten your domain account. Set strong login password and change it every few periods. Keep those credentials in safe place and don't leak to anybody.
Don't sell your domain DNS. Someone might request you to add a wildcard dns to point a specific ip address at a good price. You might find it hard to refuse because you have been trying to be profitable on your site. However, don't do it unless you know exactly what the person is and what he's going to do with your domain. Mistake from the beginning will bring disaster to your entire site property.