Fix letsencrypt after changing directadmin ip (SSL_ERROR_BAD_CERT_DOMAIN)

After following the directadmin guide you will often find SSL certs not working as they should, the easiest way I have found is to just build letsencrypt:

cd /usr/local/directadmin/custombuild
./build rewrite_confs
./build update
./build letsencrypt

Now just restart directadmin and no longer will you get SSL_ERROR_BAD_CERT_DOMAIN.