Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Blocking websites on Linux

  • 19-02-2023 11:31AM
    #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,809 ✭✭✭✭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