With www prefix my domain is not working while without www its working

Cause : The CNAME and A records have not added properly.

Solution : Please add the A record with the domain name with and without www prefix

Login to the Plesk panel==>Under Web Site option click on DNS Settings
==> Then click on the Add record icon ==> then add the two A record
Example :

You can add the CNAME record also

If you are at on the admin then you can login to the remote server through command line
Please login to the Plesk Panel Database and run the below query.

~# mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa

mysql> select domains.name as domain, dns_recs.id as dns_recs_id, dns_recs.host, dns_recs.type, dns_recs.val from domains, dns_recs where domains.dns_zone_id=dns_recs.dns_zone_id and dns_recs.host like ‘www.%’ and domains.name=’DOMAIN.TLD’;

Please put your DOMAIN.TLD ==>your domain name

It will show the details with
Domain dns_recs_id host type val

Please remove the record with ID 17
mysql> delete from dns_recs where id=17;
Query OK, 1 rows affected (0.00 sec)

Add CNAME record into domain’s DNS zone:

~# /usr/local/psa/bin/dns –add DOMAIN.TLD -cname ‘www’ -canonical DOMAIN.TLD
SUCCESS: Creation of DNS record in Domain ‘DOMAIN.TLD’ complete.

Direct Solution From IIS

We have add the www prefix for any domain running on the server which has not opening with www prefix
Fixed this issue through IIS

Step 1:Login into windows vps, dedicated server from remotely connection, or local PC through control panel direct
Step 2:Goto IIS Manager by select start -> settings -> control panel -> Administrative Tools -> Internet Information Service (IIS) Manager
Or Directly right click on the particular IIS running website and click on properties.
Step 3:In left panel select websites , and in listed website right click on the website that you want add www alies and select properties
Step 4:In properties windows select website tab and then click Advanced,now you will get Advanced Website Identification window in that click Add
Step 5:Now give IP address of server and give 80 as port and give website with www extension ( for example www.quickhosting.in ) in Host header value and click ok
Step 6:Now restart the IIS service [You must be restart the IIS by clicking right click]


About the Author