Results 1 to 4 of 4

Thread: 18.04 Firefox ignoring /etc/hosts?

  1. #1
    Join Date
    Jan 2008
    Location
    Kansas
    Beans
    556
    Distro
    Kubuntu 20.04 Focal Fossa

    18.04 Firefox ignoring /etc/hosts?

    I have a custom hosts file that blocks some time-wasting websites. I use cron to switch it to /etc/hosts at certain times during the day, and then to set the hosts file back to normal during other times.

    For the past while, however, Firefox seems to be ignoring the hosts file.

    If I ping the site, it pings 127.0.0.1 (which is what it's set to do in the custom hosts file). If I try to open the site in Chromium, I get an error message as expected. So I know that cron and the hosts file are both working. But even if I clear my cache and close and re-open Firefox, it still loads the sites.

    Any idea what's going on here?

  2. #2
    Join Date
    Mar 2018
    Location
    Germany
    Beans
    79
    Distro
    Lubuntu

    Re: 18.04 Firefox ignoring /etc/hosts?

    FF now uses DNS over HTTPS. You can disable that in the proxy settings.
    Or you can switch to another browser that doesn't use DNS over HTTPS.

    EDIT:
    DNS over HTTPS means a bypass of you local DNS server settings and the hosts file.
    Last edited by pcfan1234; January 20th, 2020 at 02:02 PM.

  3. #3
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: 18.04 Firefox ignoring /etc/hosts?

    Quote Originally Posted by pcfan1234 View Post
    EDIT:
    DNS over HTTPS means a bypass of you local DNS server settings and the hosts file.
    Not necessarily true. I've been using DNS over HTTPS for a few years. There is a local caching server which acts like the DNS server for the system, but sends any DNS requests external if the DNS record has expired. For my domains, I use a 60 min timeout on DNS records to limit DNS hits - my external DNS provider charges by the number of hits each month.

    Also, there is a setting to disable the new firefox behavior. Google finds it easily.
    https://support.mozilla.org/en-US/kb...ttps#w_opt-out

    This is nothing new. Android 6+ has ignored local /etc/hosts files for a long time. Only people running LAN web servers usually notice these sorts of things. It was a big hassle until my tablet finally became root-able about a year ago.

  4. #4
    Join Date
    Jan 2008
    Location
    Kansas
    Beans
    556
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: 18.04 Firefox ignoring /etc/hosts?

    Thanks TheFu, that link was helpful. I used the network.trr.excluded-domains setting to add exceptions for the sites I want to block, and everything else continues to use DNS over HTTP.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •