0

Having an issue trying to point a CNAME to my Digital Ocean droplet

I created a CNAME on DNSimple and pointed it to the IP address of my Digital Ocean droplet: ironman4x4.adamgeorge.com

I've tested that it exists:

→  ~  host -t cname ironman4x4.adamgeorge.com
ironman4x4.adamgeorge.com is an alias for 128.199.176.45.

My Digital Ocean droplet was created using this guide:

https://www.digitalocean.com/community/tutorials/how-to-use-the-1-click-ruby-on-rails-on-ubuntu-14-04-image

The 1-click install creates a default site here which I tried customising the root and server_name options:

server {
        listen   80;
        root /home/rails/current/public;
        server_name _ ironman4x4.*;
        index index.htm index.html;

        client_max_body_size 5M;

        location / {
                try_files $uri/index.html $uri.html $uri @app;
        }

    location ~* ^.+\.(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|mp3|flv|mpeg|avi)$ {
                        try_files $uri @app;
                }

         location @app {
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $http_host;
                proxy_redirect off;
                proxy_pass http://app_server;
    }

}

Not sure why it's not working.

I can't SSH onto the server via ssh [email protected], nor does Nginx respond via http://ironman4x4.adamgeorge.com

Not sure why?

Is there anything else I need to configure for either the DNS or or the droplet to get this to work?

3
  • Why the downvote?
    – asgeo1
    Oct 26, 2014 at 21:35
  • I assume that the downvote is because the voter expects that the target audience of this site know the difference between a CNAME and an A record.
    – mattdm
    Oct 27, 2014 at 0:03
  • @mattdm - that's disappointing. I'm a software developer not a sysadmin. I know some differences between CNAMES and A records, but I don't know much compared to someone who regularly deals with DNS. Certainly on Stack Overflow we don't downvote people for asking easy programming questions. Maybe I should have asked there instead
    – asgeo1
    Oct 27, 2014 at 20:49

2 Answers 2

4

The CNAME record type makes one name into an alias of another name.

Ie, the value of your CNAME record is not an IP address but a name with all-numeric labels.

You probably simply want to create an A record instead.

1
  • Thanks. I thought that may have been the case (that I needed to use a A record), but I didn't have a spare domain to play with and thought I would try a CNAME instead. When it didn't work with the CNAME, I wanted to know why it didn't work. Since I had pointed CNAMES to external sites before (i.e. Heroku), I just assumed that would work with an external IP address to. Cheers.
    – asgeo1
    Oct 27, 2014 at 20:52
0

You need to be using an A record, not a CNAME.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .