Issue with the custom domain when trying to use Let's Encrypt to setup HTTPS

I want to have a custom domain for my custom app in ERPNext. How can I do it?
I have followed the next guides:

  1. Adding Custom Domains to your Site
  2. Setup DNS based Multitenancy
  3. Using Let’s Encrypt to setup HTTPS
  4. Configuring HTTPS

I suppose that the configuration fails when I set the custom domain with the command bench setup add-domain [custom-domain] because, when I try to use the command sudo -H bench setup lets-encrypt [site-name] --custom-domain [custom-domain], I get this error:

Failed authorization procedure. (http-01): urn:ietf:params:acme:error:dns :: DNS problem: NXDOMAIN looking up A for

 - The following errors where reported by the server:

   Type:    None
   Details: DNS problem: NXDOMAIN looking up A for

There was a problem trying to setup SSL for your site

What I can be doing wrong?

Is your custom domain live?
And did you point ur custom domains A record to the erpnext server IP ?
Above error says that dns lookup for ur domain failed to get any A record.

Hope this helps.

Your frappe app server must have its own IP address. Say
Say your domain name is
If you want your frappe app to resolve at
Your DNS Zone File’s primary A Record must point towards this IP
If you have an existing website at (located at say 456.456.456.4) and you want your frappe app to resolve to a subdomain like You need to add a second A record to your DNS Zone File that points to your frappe app server. Your primary A record points to your website at 456.456.456.4 Then add another A record with an IP address of

On your app server:
From within frappe-bench folder create a site called