How to Enable Stub Resolvers


Last modified: March 26, 2024

Overview

This document describes how to enable stub resolvers for your server.

Warning:
  • We strongly recommend that you do not enable this method. We do not support this behavior.
  • This method can cause problems with your server configuration.
  • This procedure will make AutoSSL error messages significantly less useful.

Enable stub resolvers

This feature uses your system’s resolvers instead of relying on external DNS. If you or your system administrator blocks port 53 outside of your network, stub resolvers can perform DNS for your servers.

Warning:

This method only resolves issues related to intentionally blocking port 53. Do not use this method, for example, as a workaround for issues with your NAT configuration. Instead, properly set up your NAT configuration.

To enable stub resolvers, perform the following steps:

  1. Run the following to confirm that the dig command work:
    /scripts/cpdig google.com mx
  2. Run the following to set up a dangling symlink:
    ln -s stub /var/cpanel/dns_unbound_resolve_mode
  3. Run the following to confirm that the dig command works with the strace option added:
    strace -o cpdig.strace /scripts/cpdig google.com mx
  4. Verify that the strace option is showing the stub that the resolver is using:
    grep -A2 stub cpdig.strace
    Your output should resemble the following:
    readlink("/var/cpanel/dns_unbound_resolve_mode", "stub", 4095) = 4
    open("/etc/resolv.conf", O_RDONLY) = 8

Additional Documentation