Simply adding a new entry to your /etc/hosts file may not be enough to access it on Firefox.
127.0.0.1 mydomain.com
Go to Settings > Network Settings and check the "Enable DNS over HTTPS" option. Make sure you restart the browser before accessing the host.
Learn more at the Firefox Support page.