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:

Not working website:

DNS Checker shows valid CNAME resolution:

.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;

        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.   3600    IN  CNAME   3600    IN  CNAME

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.