DNS - ERR_NAME_NOT_RESOLVED

January 3, 2019 700 views
DNS Ubuntu 18.04

I’ve bought a domain gejr.dk since it’s a .dk the DNS records must be changed at dk-hostmaster.dk which I have done, this is the current config.

Current nameservers
    * ns1.digitalocean.com
    * ns2.digitalocean.com
    * ns3.digitalocean.com

No other configurations can be done at dk-hostmaster.

I configured my DNS records like this:

A   gejr.dk directs to 68.183.208.10        3600
NS  gejr.dk directs to ns1.digitalocean.com.    1800
NS  gejr.dk directs to ns2.digitalocean.com.    1800
NS  gejr.dk directs to ns3.digitalocean.com.    1800

I then followed this tutorial on how to setup Nginx https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04

However when I reached the point where I should be able to go to http://gejr.dk I get the error

This site can’t be reached
www.gejr.dk’s server IP address could not be found.
ERR_NAME_NOT_RESOLVED

When I try to connect to the IP directly it works eg http://68.183.208.10/ shows test

After looking at multiple previous answers on similar questions, I changed my DNS records to this:

CNAME   *.gejr.dk       is an alias of gejr.dk.         43200
CNAME   www.gejr.dk is an alias of gejr.dk.         43200
A       gejr.dk     directs to 68.183.208.10        3600
NS      gejr.dk     directs to ns1.digitalocean.com.    1800
NS      gejr.dk     directs to ns2.digitalocean.com.    1800
NS      gejr.dk     directs to ns3.digitalocean.com.    1800

But still it doesn’t work.

I have an index.html located in /var/www/gejr.dk/html/index.html this file should output something like Gejr.dk works! and I have an index.html located in /var/www/html/index.html this file outputs test It’s this file you see when you connect to the ip directly.

I have a file located in /etc/nginx/sites-available/gejr.dk which contains the following:

server {
        listen 80;
        listen [::]:80;

        root /var/www/gejr.dk/html;
        index index.html index.htm index.nginx-debian.html;

        server_name gejr.dk www.gejr.dk;

        location / {
                try_files $uri $uri/ =404;
        }
}

This file is linked with sudo ln -s /etc/nginx/sites-available/gejr.dk /etc/nginx/sites-enabled/

My Nginx Config file looks like this

user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
    worker_connections 768;
    # multi_accept on;
}

http {

    ##
    # Basic Settings
    ##

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    # server_tokens off;

    server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

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

    ##
    # SSL Settings
    ##

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
    ssl_prefer_server_ciphers on;

    ##
    # Logging Settings
    ##

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    ##
    # Gzip Settings
    ##

    gzip on;

    # gzip_vary on;
    # gzip_proxied any;
    # gzip_comp_level 6;
    # gzip_buffers 16 8k;
    # gzip_http_version 1.1;
    # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

    ##
    # Virtual Host Configs
    ##

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}


#mail {
#   # See sample authentication script at:
#   # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
# 
#   # auth_http localhost/auth.php;
#   # pop3_capabilities "TOP" "USER";
#   # imap_capabilities "IMAP4rev1" "UIDPLUS";
# 
#   server {
#       listen     localhost:110;
#       protocol   pop3;
#       proxy      on;
#   }
# 
#   server {
#       listen     localhost:143;
#       protocol   imap;
#       proxy      on;
#   }
#}

In the Nginx error log this is everything
2019/01/03 14:16:33 [notice] 13789#13789: signal process started

1 Answer
aha MOD January 4, 2019
Accepted Answer

Looks like it’s working now, right?

ERR_NAME_NOT_RESOLVED usually indicates a DNS caching issue, I bet it was either a slow update on dk-hostmaster.dk’s side, or cached DNS lookup info on your local network.

  • Yeah, looks like it was dk-hostmaster DNS that was slow to update, they said they update every hour, but I gave at least 4 hours shrugs well it works now.

Have another answer? Share your knowledge.