title: Rocket Chat cannot enable SSL using Caddy: libdns.so.162 not found
body: <p>I installed <a href="https://rocket.chat/" rel="nofollow noreferrer">rocket chat</a> using snap, following the documentation <a href="https://docs.rocket.chat/installation/snaps" rel="nofollow noreferrer">here</a>.</p>
  <p>Now I am trying to enable SSL following the documentation: <a href="https://docs.rocket.chat/installation/snaps/autossl" rel="nofollow noreferrer">Auto SSL with Snaps</a>. However, the following error shows up:</p>
  <pre><code>$ sudo snap set rocketchat-server https=enable
  error: cannot perform the following tasks:
  - Run configure hook of &quot;rocketchat-server&quot; snap (run hook &quot;configure&quot;: 
  -----
  dig: error while loading shared libraries: libdns.so.162: cannot open shared object file: No such file or directory
  Error: Can't resove DNS query for &lt;my_domain_name&gt;, check your DNS configuration, disabling https ...
  -----)
  </code></pre>
  <p>Checking what <code>ldd</code> has to say for <code>dig</code>, I found few other libs are also not found:</p>
  <pre><code>$ ldd /snap/rocketchat-server/current/usr/bin/dig 
      linux-vdso.so.1 (0x0000ffff98afc000)
      libdns.so.162 =&gt; not found
      liblwres.so.141 =&gt; not found
      libbind9.so.140 =&gt; not found
      libisccfg.so.140 =&gt; not found
      libisc.so.160 =&gt; not found
      libpthread.so.0 =&gt; /lib/aarch64-linux-gnu/libpthread.so.0 (0x0000ffff98a71000)
      libc.so.6 =&gt; /lib/aarch64-linux-gnu/libc.so.6 (0x0000ffff98900000)
      /lib/ld-linux-aarch64.so.1 (0x0000ffff98acc000)
  </code></pre>
  <p>So, checked if <code>libdns.so</code> exists at all.</p>
  <pre><code>$ locate libdns.so
  /snap/rocketchat-server/1437/usr/lib/aarch64-linux-gnu/libdns.so.162
  /snap/rocketchat-server/1437/usr/lib/aarch64-linux-gnu/libdns.so.162.1.3
  /usr/lib/aarch64-linux-gnu/libdns.so.1601
  /usr/lib/aarch64-linux-gnu/libdns.so.1601.0.0
  </code></pre>
  <p>It appears that the concerned library exists under snap.</p>
  <p>Is there a way to resolve this and make caddy/https work?</p>
  <hr />
  <p>System:</p>
  <ul>
  <li>Raspberry Pi 4 (aarch64)</li>
  <li>Linux ubuntu 5.4.0-1022-raspi</li>
  <li>Ubuntu Server 20.04.1 LTS</li>
  </ul>
  <hr />
  <p>Similar issues:</p>
  <ul>
  <li><a href="https://stackoverflow.com/questions/62675537/dig-error-while-loading-shared-libraries-libdns-so-162-cannot-open-shared-obj">dig: error while loading shared libraries: libdns.so.162: cannot open shared object file: No such file or directory</a></li>
  <li><a href="https://stackoverflow.com/questions/17360593/shared-libraries-of-dig-and-nslookup">shared libraries of dig and nslookup</a></li>
  </ul>