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 example.mx is working as http://www.example.mx. With www there is no problem, but with non-www like http://example.mx it's not working.

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

What could be the problem which is causing http://example.mx not to work while http://www.example.mx 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 example.mx 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 vuelosenglobos.mx

Remove the DNS Entry:

    vuelosenglobo.mx NS  ns1.vuelosenglobos.mx

Add the DNS entry:

    vuelosenglobo.mx CNAME  ns1.vuelosenglobos.mx

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

name servers are different devices from web servers.

drtechno
drtechno
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