You may want to look into systems like acme-dns or agnos, which are designed to let you integrate them into your DNS in a way that does make the DNS challenge easy to automate.