I’ve scoured through the questions and answers to this and still haven’t been able to fix the issue. I’ve also applied the answers stated here
-https://www.digitalocean.com/community/questions/www-domain-com-not-working
and here

I have set up two CNAME configurations:

CNAME *domain.com is an alias of domain.com. TTL 600

CNAME www.domain.com is an alias of domain.com. TTL 600

TTL was initially 1800 but that didn’t make a difference.

All of this is inline with the answer given here (https://www.digitalocean.com/community/questions/www-domain-com-not-working) and still when I add www to the domain, the website doesn’t load.

I don’t know what else to do anymore :(

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hi @gabrielClam,

Firstly, make sure you are making the DNS changes at the proper place. If you are using DigitalOcean, then make sure you are using the following Nameservers:

  • ns1.digitalocean.com
  • ns2.digitalocean.com
  • ns3.digitalocean.com

You can read more about this here :

https://www.digitalocean.com/docs/networking/dns/how-to/

Now, when you are sure your DNS is being managed from DigitalOcean you can start editing it from your control panel. Firstly, make sure your root Domain name, let’s say it’s example.com have an A record like so :

A example.com   directs to  XXX.XXX.XXX.XXX 300
  • The first column is the type of DNS record - A
  • The second column is your Domain name, notice it’s the root one
  • The third column states where it directs to
  • The fourth column is the IP you’ve made it direct to. Here it’s XXX.XXX.XXX.XXX however it will be a real one when you add it.
  • The last column is your TLS.

Never ever ever configure your root domain name as a CNAME your whole DNS zone will stop working.

Now that you have made sure your root domain is configured properly,try to ping it in your terminal:

ping example.com

If it works, that’s great you can now turn your attention to your WWW record. You have two options here. The first one would be to make www.example.com use an A record, the second would be to use CNAME record. As you already know how to make it work as an A record, I’ll show you how to do it as a CNAME record:

CNAME www.example.com   is an alias of example.com 300 
  • The first column again is the Type of DNS record
  • The second column is the domain/subdomain you wish to add a DNS record for
  • The third column states www.example.com is an alias of example.com, which means they load the same content and direct to the same IP.
  • The fourth column is the domain that’s being used as an alias to.
  • The last column is again the TLS.

Regards,
KDSys

  • Thank you KDSys for the detailed response. I’ve set up my DNS as follows excluding NS section as:

    A www.domain.com directs to
    1xx.xx.xx.xxx

    1800

    A domain.com directs to
    1xx.xx.xx.xxx

    1800

    CNAME *.domain.com is an alias of
    domain.com.
    600

    on another domain that has the same issue, I’ve configured the settings as:

    CNAME *.domain.com is an alias of
    domain.com.
    1800

    CNAME www.domain.com is an alias of
    domain.com.
    600

    A domain.com directs to
    1xx.xx.xx.xxx

    1800

    I’ll give it some time to propagate and then come back to update this thread

Submit an Answer