How to point CNAME to Digital Ocean droplet

asgeo1 asked:

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:

I’ve tested that it exists:

→  ~  host -t cname is an alias for

My Digital Ocean droplet was created using this guide:

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

Not sure why?

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

My answer:

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

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.