Hello,
In Linux you can open your terminal and enter $sudo gedit /etc/hosts and there add sites you want to block systemically so it doesn't matter what browser you use, the website won't work without a need to install any third party apps which may be spywares or other cancer you don't want to have.

My question is, can I do something like this on Graphene OS?

I already updated my DNS to block ads but I want to block some websites like Facebook or Instagram to not be able to open it at all.

Can I do that?

    Hey there! I believe you could theoretically have your own DNS with your own rules and use that. There are probably other solutions that allow you to block specific domains, but they would need to take up your VPN slot, which may or may not be what you want.

    How do I do DNS with my own rules then? I searched online through many materials and I cannot see anything related to what I actually want.

    In terms of VPN solution, for now I have the Nord VPN which I am using from time to time but I plan to change it to Proton VPN when this licence finishes.

    A very easy way would be to change your upstream DNS server to OpenDNS. You can set up an account for free, then modify your DNS settings however you like. They provide the option of blocking any domain you want.

    • [deleted]

    Mwk
    Of course you can do it but unfortunately using 3rd party app.
    I described it here

    You can use NetGuard, which allows you to use custom hosts file.

    • Mwk likes this.
    7 months later

    Re-awakening this older thread... I have three phones on GrapheneOS- two Pixel 6 and one Pixel 7 for my little daughter. Trying to block youtube shorts using OpenDNS on my home network. To do this: 1) set up OpenDNS account and register IP of router 2) At OpenDNS config page, select "block video sharing sites" 3) ensure phone is in fact using router wifi not mobile data.

    WEIRD THING IS on my phone (Pixel 6) this works. Cannot reach any youtube site. But on her phone (Pixel 7) it blythely connects to youtube as usual. WTF?

    Another thing. On my phone if you set "use mobile data" to OFF, it stays OFF. You have no internet when out and about. On her phone (Pixel 7) mobile data mysteriously re-enables itself. This happens even when in addition I set a mobile data limit- it gives nag alerts but re-enables or continues to use mobile data. It is not the child changing settings because I have Timelimit installed and she cannot access Settings.

    Any assistance here? Thanks a lot!

    ...another weird difference between Pixel 6 & 7 behavior: On the 6, setting "preferred network type" to 3g disables mobile data, since 3g network is no longer active. (This was a suggestion from my provider as to how to block mobile data.) On the 7, this setting has no effect- device happily connects to LTE or whatever's available.

    Can this be fixed so 7 acts like 6 & I can get kid to look out the window in the car rather than staring at the phone?

    OK. partially solved it. On the Pixel 6 setting Private DNS to router IP does make OpenDNS blocks effective. And it is the router IP that shows in router network settings display. On the Pixel 7, it is necessary to set Private DNS to dns.opendns.com. Then the OpenDNS blocking settings are effective. HOWEVER, there is still something wrong since the router network settings display now shows DNS as old Cloudflare public DNS, which I used before getting involved with OpenDNS. Cloudflare has no blocking.

    I'd still like some authoritative comment on this thread. Why does Pixel 7 behave differently than Pixel 6?