ERR_NAME_NOT_RESOLVED but DNS seems to be valid

MichaelS asked:

I have an Azure VM runnig docker with an Nginx container and dns config with CNAME entries pointing to that Azure VM. The Website is not available in browsers (ERR_NAME_NOT_RESOLVED in Chrome). The Azure website itself is available.

Working website: http://test-plattform.westeurope.cloudapp.azure.com/

Not working website: http://dev.flamplattform.ch

DNS Checker shows valid CNAME resolution: https://dnschecker.org/#CNAME/dev.flamplattform.ch

.nginx config

worker_processes auto;

events {
    worker_connections  1024;
}

http {
    charset utf-8;
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    log_not_found off;
    types_hash_max_size 2048;

    include mime.types;
    default_type application/octet-stream;

    # some security headers here...

    server {
        listen 80;
        listen [::]:80;
        server_name dev.flamplattform.ch test-plattform.westeurope.cloudapp.azure.com;

        location / {
            proxy_pass         http://app:80;
            proxy_http_version 1.1;
            proxy_set_header   Host $host;
            proxy_set_header   X-Real-IP $remote_addr;
            proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header   X-Forwarded-Host $server_name;
            proxy_set_header   X-Forwarded-Proto $scheme;
            proxy_cache_bypass $http_upgrade;
        }
    }
}

My answer:


Your CNAME records for www and dev have an obvious typo.

dev.flamplattform.ch.   3600    IN  CNAME   test-plattform.westeurope.cloudapp.azure.com/.
www.flamplattform.ch.   3600    IN  CNAME   test-plattform.westeurope.cloudapp.azure.com/.

Remove the erroneous / from the end of the record.

Your DNS provider should have never allowed you to even create these records, but apparently they don’t validate input very well…


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.