My root domain is not resolving to my server, but the www. subdomain works fine

by Fernando Urban   Last Updated October 18, 2019 20:04 PM - source

I have the DNS configured like this:

enter image description here

So, my domain is working as With www there is no problem, but with non-www like it's not working.

As you can see, my DNS records are pointing in record to the NS Actually, is pointing to my server's IP.

What could be the problem which is causing not to work while does work?

Tags : dns cname no-www

Answers 2

To resolve your host name to an IP address you need either an A or CNAME record for it. For a bare domain, it has to be an A record, a CNAME only works for sub-domains. You don't have an A record for your bare domain name, you only have NS and SOA records.

Your CNAME resolves to some IP address. If you don't know the IP address you can usually look up the IP address for the host of the CNAME and use that.

Sometimes CNAME records point to dynamic IP addresses that change fairly frequently. If that is the case, you will also need to set up the A record for your bare domain to get updated at the same time. Alternatively you can find a DNS host that uses ALIAS or ANAME records. Those are proxy records that return an A record with an IP address based on a dynamic lookup from some other host. Not all DNS hosting offers this option (most don't).

You have both A and CNAME records for www. That isn't usual and it could cause problems. I don't see any records for the ns. subdomain the CNAME is pointing to, so I doubt it is actually functional.

I would recommend:

  • Add an A record for pointing to your server's IP address
  • Remove the CNAME record for www.

To get your web site working, you may additionally need to configure your web server to show your site for your bare domain. It isn't always enough just to point a host name at your web server. You also usually have to add virtual host configuration for it as well.

Stephen Ostermiller
Stephen Ostermiller
October 18, 2019 19:44 PM

The "A" entry is correct, because you made a CName fowarding entry to the domain

Remove the DNS Entry: NS

Add the DNS entry: CNAME

by the way, Its unusual to see ns1 as a web server subdomain, but whatever

name servers are different devices from web servers.

October 19, 2019 19:21 PM

Related Questions

CNAME is causing redirect error?

Updated November 26, 2016 07:14 AM

Using CNAME with Route 53

Updated August 22, 2015 17:01 PM