News:

SMF - Just Installed!

Main Menu

How to add a wildcard DNS record?

Started by Dipak Bhoi, April 28, 2014, 11:25:16 AM

Previous topic - Next topic

Dipak Bhoi

Hello guys,

This post will help you to understand what is the wildcard DNS record and how to set them .

What is the wildcard DNS record ?

A wildcard DNS record is a record in a DNS zone file that will match requests for non-existent domain names, e.g if you have a number of sub-domains and you wish to redirect all of them to your main domain regardless of what sub-domain they access. It is also useful in case when someone miss type the address of site, e.g they type ww.yourdomain instead of www.yourdomain then they will automatically redirect to your main domain.

How to add a wildcard DNS record ?

1. Login to WHM and go to Edit DNS Zone
2. Select the domain you wish to modify from the list of available websites.
3. Fill in the fields under Add New Entries Below this Line.

Quote*                       14400            IN                     A               xxx.xxx.xxx.xxx

where xxx.xxx.xxx.xxx is the server IP.

Below is a another way, but you need root access to do this.

1. Login to server via ssh as a root user.
2. Edit file httpd.conf file. (path = /usr/local/apache/conf/httpd.conf)
3. Find the VirtualHost entry for the website.
4. The modificaton you need to change is ServerAlias www.yourdomain.com to
    ServerAlias *.yourdomain.com

5. Save the file and restart the httpd servcie.

Enjoy !!!
MilesWeb - 30-Day Money Back
cPanel Web Hosting - cPanel Hosting in India
Grab a Free SSL for your website.  WordPress Optimized Solution.