site not loading on Safari (DNS error), CNAME not working.

February 25, 2016 1.2k views
DigitalOcean DNS Networking Nginx

Hi,
I'm trying to get my domain setup with a droplet so that when you enter in "domain.com" it will go to "www.domain.com". I used to use a wildcard CNAME, but that didn't work, and setting up the A record with the www prefix doesn't seem right (after digging around on the internet)

What am I doing wrong? Also, neither version of the site loads on Safari, but the www.domain.com loads on chrome. Weird.

DNS Record

1 comment
  • Hi, DNS changes can take many hours before it's updated.
    So if you think you set it up right, you have to wait and see.

    For my set up I have just set up A-name records that point to my floating ip.
    The floating IP points to the VPS. You dont have to have a floating ip, but it makes it possible to switch servers in the future without waiting for DNS-changes. Also you can make failover clusters etc.

    inside nginx I have a server block that listens for both www.domain.tld and domain.tld
    Then I have another server block for redirect (https).

    In theory I could have one block for www with redirect and one for just domain.tld.
    There are many options, but you have a simple thing that ties it together:

    • DNS point A-name to the IP that works for your server.
    • Server has to listen for domains
1 Answer

This question was answered by @olavamjelde:

Hi, DNS changes can take many hours before it's updated.
So if you think you set it up right, you have to wait and see.

For my set up I have just set up A-name records that point to my floating ip.
The floating IP points to the VPS. You dont have to have a floating ip, but it makes it possible to switch servers in the future without waiting for DNS-changes. Also you can make failover clusters etc.

inside nginx I have a server block that listens for both www.domain.tld and domain.tld
Then I have another server block for redirect (https).

In theory I could have one block for www with redirect and one for just domain.tld.
There are many options, but you have a simple thing that ties it together:

  • DNS point A-name to the IP that works for your server.
  • Server has to listen for domains

View the original comment

Have another answer? Share your knowledge.