send() failed (111: Connection refused) while resolving, resolver: 127.0.0.1:53

7,849

Hi

Had a same fresh error in my nginx error.log

2019/04/16 14:18:49 [error] 16988#0: send() failed (111: Connection refused) while resolving, resolver: 127.0.0.1:53

For me helped below Check first your DNS Nameservers.

My example is for dns resolver godaddy. with:

ns47.domaincontrol.com

ns48.domaincontrol.com

Make an nslookup for these domains and you will get two IP-s. Update your /etc/resolv.conf with given nslookup in domain:

  • search domaincontrol.com
  • nameserver 97.74.103.24
  • nameserver 173.201.71.24

Save file, restart nginx and wait few sec. My error message dissapeared from logs. Hope it helps.

Share:
7,849

Related videos on Youtube

Quintin Par
Author by

Quintin Par

Quintessential learner and programming newbie..

Updated on September 18, 2022

Comments

  • Quintin Par
    Quintin Par over 1 year

    Because of SSL stalping errors I had to set

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
    ssl_prefer_server_ciphers on;
    ssl_stapling on;
    resolver 127.0.0.1;
    ssl_stapling_verify on;
    

    But since then I’ve been hit with this error

    send() failed (111: Connection refused) while resolving, resolver: 127.0.0.1:53
    

    How do I resolve this?

    • Michael Hampton
      Michael Hampton over 5 years
      Use the correct IP address of your nameserver.
  • Janaka Bandara
    Janaka Bandara about 3 years
    On AWS, the problem was resolved when I added the nameserver available in /etc/resolv.conf as the first priority (leaving the previously added 8.8.x.x Google nameservers as secondary/tertiary fallbacks)