title: How to debug mystery ENOTFOUND?
body: <p>I am getting random restarts on a PM2 managed nodejs cluster.  The only symptom I get on the error log is of the following pattern - an ENOTFOUND on dns.js.  </p>
  
  <blockquote>
    <p>Error: getaddrinfo ENOTFOUND walkinto.inhttp walkinto.inhttp:80
       at errnoException (dns.js:28:10)
       at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)</p>
  </blockquote>
  
  <p>Clearly the problem is a malformed server name - <b>walkinto.inhttp</b> is incorrect and it should be <b>walkinto.in</b> .  The challenge is that this is not a host name hard coded in the code.  There are many places in this fairly large code base that makes name resolution and it is of dynamic nature.  </p>
  
  <p>I have spent considerable time to pinpoint the root cause but so far have had no luck.  I need help to print more log information from dns.js; probably a call stack 'may' would help to move forward.  </p>
  
  <p>Q1 : How to enable more detailed logging on nodejs core modules?</p>
  
  <p>Q2 : What could cause a nodejs restart to happen for an ENOTFOUND?  How to avoid a restart - This path is not desirable.</p>
  
  <p>Q3: Are there any other smarter way to trouble shoot this problem?</p>