DNS error during certbot

Let's Encrypt is a public Certificate Authority and must validate your host name using the public internet starting with the DNS.

There are ways to get certs for purely local names. Some discussion is at below topic. You will also find others posts here talking about smallstep and other methods. Try searching

One example thread here