In many cases we require to enable wild card DNS service for the domain. These are the steps to accomplish it for cPanel server:
1) Login into WHM.
2) Click On Edit DNS Zone.
3) Choose domain to edit and click on edit button.
4) Add new record entry as under:
Now, we need to modify httpd.conf file from the server end.
1) Login into SSH as root.
2) go to the httpd.conf file. It should be located at:
etc/httpd.conf
3) now edit this with online text editor. [I have used vi editor]
vi httpd.conf
4) Find your domain entry like:
ServerAlias yourdomain.com
ServerAdmin webmaster@yourdomain.com
DocumentRoot /home/yourdomain/public_html
BytesLog domlogs/yourdomain.com-bytes_log
ServerName www.yourdomain.com
User yourdomain
Group yourdomain
CustomLog /usr/local/apache/domlogs/yourdomain.com combined
ScriptAlias /cgi-bin/ /home/yourdomain/public_html/cgi-bin/
On the line:
ServerAlias yourdomain.com
Change to:
ServerAlias: *.yourdomain.com yourdomain.com
5) Save the file and exit.
[command: CTRL +:wq]
6) Restart the Apache web server by executing this command:
# service httpd restart
1) Login into WHM.
2) Click On Edit DNS Zone.
3) Choose domain to edit and click on edit button.
4) Add new record entry as under:
- TTL 14400
- Record Type: A [Domain IP address]
- Record Data: *
Now, we need to modify httpd.conf file from the server end.
1) Login into SSH as root.
2) go to the httpd.conf file. It should be located at:
etc/httpd.conf
3) now edit this with online text editor. [I have used vi editor]
vi httpd.conf
4) Find your domain entry like:
ServerAlias yourdomain.com
ServerAdmin webmaster@yourdomain.com
DocumentRoot /home/yourdomain/public_html
BytesLog domlogs/yourdomain.com-bytes_log
ServerName www.yourdomain.com
User yourdomain
Group yourdomain
CustomLog /usr/local/apache/domlogs/yourdomain.com combined
ScriptAlias /cgi-bin/ /home/yourdomain/public_html/cgi-bin/
On the line:
ServerAlias yourdomain.com
Change to:
ServerAlias: *.yourdomain.com yourdomain.com
5) Save the file and exit.
[command: CTRL +:wq]
6) Restart the Apache web server by executing this command:
# service httpd restart
Comment