Install Sitecore 9.1 Cannot validate argument on parameter 'DnsName' - parameter doesn't exist in the json config

I run in this error by run Install-SitecoreConfiguration -Path createcert.json.

The json file is from the xp0 package and it contains no parameter DnsName. I just found a variable like this:

"Variables": {
"Root.Cert.DnsName": "[concat('DO_NOT_TRUST_', parameter('RootCertFileName'))]"


The error:

Install-SitecoreConfiguration : Cannot validate argument on parameter 'DnsName'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\ops\int\SIF\install.ps1:10 char:1 + Install-SitecoreConfiguration @createcert + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The DNSName variable used by the CreateRootCert task is taken from that SIF variable. As it has a default, you don't need to supply anything.
The error you got would have been from the CreateSignedCert task, which in turn links back to the "CertificateName" parameter.
You would need to run something like Install-SitecoreConfiguration -Path .\createcert.json -CertificateName mysite.somedomain.com to have it create a self-signed cert.