Issues with subdomain not working (but works when I hardcode the ip in hosts file)

March 11, 2015 1.7k views
DNS Nginx Ubuntu

I'm trying to point a subdomain to my droplet running a nginx server. Somewhere along the way I've done something wrong and when I try to go to my subdomain I get "Gateway Timeout: can't connect to remote host."

I'm pretty sure it's an issue with the DNS because when I add my subdomain to my hosts file and point it to my droplet's ip address everything works great.

The following is my zone file on DO:

$TTL 1800 IN SOA 1423974942 10800 3600 604800 1800 1800 IN NS 1800 IN NS 1800 IN NS 1800 IN A

The domain is managed by NameSilo and I have the following settings:

      A             NA  172816  www re-direct       
      A             NA  172816  www re-direct       
      A          NA  172816  www re-direct       
blog      CNAME  NA  172817  3rd-party       
www     CNAME           NA  172816  3rd-party       

Can anyone see what I'm doing wrong? Thanks in advance!

5 Answers

Delete the zone from DO. On namesilo, delete the CNAME record for blog. Create an A record for blog to

Don't over-complicate things, and I highly recommend learning more about how DNS works.

Isn't the ip address dependent on the droplet? i.e. if I created a new droplet and wanted to use that I'd have to modify my hosting DNS again rather than just the DO side.

I understand why the new system would work, but can you explain why the old system wasn't working?

Yes, you will need to change the IP if the IP of the droplet changes.

I don't think you understand how DNS works.

A CNAME says to use the IP whatever hostname is referred to. If you cname blog to, then the cname will return the IP of, not your host.

Unless you have the DNS delegated for your domain to ns1/ns2/ns3 at digitalocean, and completely control your domain on their name servers, whatever you put into DO's domain manager won't have any effect.

Ah ok. Things are starting to make sense. I was confusing what I'd done with NameServers with DNS records.

So... is it better to use NameSilo for DNS or do all of that from the DO side (meaning if I used the DO nameservers)?

  • I honestly couldn't tell you which is better. I run my own name servers, and don't have a need to use DOs or my registrars. Its more of a matter of what you feel more comfortable using.

Ok cool. Thanks a lot for your help!

Have another answer? Share your knowledge.