Does Firefox ignore the hosts file? How to make Firefox honor the hosts file
Solution 1:
I had the same problem. Write about:config in the address bar.
Search for dns and change network.dns.offline-local
to false.
Solution 2:
I fixed it by disabling the "DNS Over HTTPS" Firefox Network option.