Whm-cpanel - Enabling wildcard dns on cpanel servers, How to create Wildcard DNS

Enabling wildcard dns on cpanel servers

Enabling Wildcard DNS on CPanel Servers


What is wildcard DNS

Pointing all the subdomains to the same homepage of a website is called as wildcard DNS.

For example: if you want all the following domain to the single home page.

http://www.w3calculator.com
http://sub.w3calculator.com
http://whatever.w3calculator.com
http://anything.w3calculator.com

Then you have to use wildcard DNS. For this you must have WHM and SSH access. Follow the below steps to enable wildcard DNS

1. Login to WHM
2. Select Edit DNS Zone in WHM.
3. Choose the domain to edit, and click on the Edit button.
4. Under Add New Entries Below this Line add this:
Domain: *
TTL: 14400 (this is the default value)
Record Type: A in (your IP address)
5. Submit and this will now be added.
6. Access your httpd.conf file. Login as root, via SSH.
7. To access the file in a CPanel server go to
# vi /etc/httpd/conf/httpd.conf
8. Do a find on your domain and you may find something like this:

ServerAlias yourdomainserver.com
ServerAdmin webmaster@yourdomainserver.com
DocumentRoot /home/yourdoma/public_html
BytesLog domlogs/yourdomainserver.com-bytes_log
ServerName www.yourdomainserver.com
User yourdoma
Group yourdoma
CustomLog /usr/local/apache/domlogs/yourdomainserver.com combined
ScriptAlias /cgi-bin/ /home/yourdoma/public_html/cgi-bin/

On the line:

ServerAlias yourdomainserver.com

Change to:

ServerAlias: *.yourdomainserver.com yourdomainserver.com

10. Exit or press Ctrl X if using Pico.
11. Save the file when asked and replace the existing file.
12. Restart the apache web server by typing in:
# service httpd restart

Thats it. Now you have enabled the wildcard domains.

The topic on Whm-cpanel - Enabling wildcard dns on cpanel servers is posted by - Math

Hope you have enjoyed, Whm-cpanel - Enabling wildcard dns on cpanel serversThanks for your time

Tech Bluff