Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Blocking websites on Linux

  • 19-02-2023 12:31PM
    #1
    Registered Users, Registered Users 2 Posts: 25 Yoshitsune


    I am looking to block websites to avoid procrastinating and to focus on work. Can anyone explain how to block unwanted websites?



Comments

  • Registered Users, Registered Users 2 Posts: 12,333 ✭✭✭✭LambshankRedemption




  • Posts: 24,207 ✭✭✭✭ Beckett Round Crab


    Try:

    sudo nano /etc/hosts

    You can now edit the file to block specified websites you don’t want to see. You need to add a new line for each one. 

    Enter ip address 127.0.0.1 followed by domain name, eg www.boards.ie

    Save file ctrl + x, followed by y to confirm the save. 

    Hope it works for you! 

    edit - just make sure of your path to the “hosts” file when using the nano editor in the terminal. I’m sure you know this, you can use “find hosts” to get to it and then type “pwd” to determine the exact path and work away with “sudo nano” followed by that path.

    Post edited by [Deleted User] on


Advertisement