I read that as being about the actual public DNS, not your own local hosts file?
Malicious network could forge DNS responses and direct user into fake server. HTTPS should protect user, because face server can't own proper certificate for that domain. But if private key is leaked, this attack could work.
Re:Certificates for localhost
by icebraining on Thursday June 21, 2018 @07:18AM
(#17363952)
There are no DNS responses if the domain is in the hosts file.
>It’s possible to set up your own domain name that happens to resolve to 127.0.0.1, and get a certificate for it using the DNS challenge. However, this is generally a bad idea and there are better options.