We have moved to a new Sailfish OS Forum. Please start new discussions there.

Revision history [back]

click to hide/show revision 1
initial version

posted 2015-11-29 13:31:26 +0200

How to block websites in "/etc/hosts"?

I tried all day long to block some websites on my jolla, but it I couldn't figure out how. I tried this

sh -c 'echo "127.0.0.1 google.de" >> /etc/hosts'

with root acces and it did appear in the hosts-file, but I could still acces google.de. I did try: www.google.de, http//google.de && http//www.google.de aswell. Do you have any idea how to do this properly? BR, Théo

How to block websites in "/etc/hosts"?

I tried all day long to block some websites on my jolla, but it I couldn't figure out how. I tried this

sh -c 'echo "127.0.0.1 google.de" >> /etc/hosts'

with root acces and it did appear in the hosts-file, but I could still acces google.de. I did try: www.google.de, http//google.de && http//www.google.de aswell. Do you have any idea how to do this properly? BR, Théo

How to block websites in "/etc/hosts"?

I tried all day long to block some websites on my jolla, but it I couldn't figure out how. I tried this

sh -c 'echo "127.0.0.1 google.de" >> /etc/hosts'

with root acces and it did appear in the hosts-file, but I could still acces google.de. I did try: www.google.de, http//google.de && http//www.google.de aswell. Do you have any idea how to do this properly? BR, Théo

PS: Feel free to edit my post to an answer and remove the "?" in the titel.

How to block websites in "/etc/hosts"?all Browsers

I tried all day long to To block some certain websites in every browser on my jolla, but your (or maybe your sons) Jolla Phone follow these simple steps:

  1. Make sure you have a Jolla account and the Jolla device can access the Jolla Store.

  2. Go to |- Settings | System Settings | Developer Mode -|.

  3. Activate „Developer mode“. Because your Jolla device can access the Jolla Store, a Terminal app is installed now.

  4. Activate „Remote connection” (either enter and [Save] a password or [Generate] it; if you generate it, you have to edit it I couldn't figure out how. I tried this

    slightly before
        the [Save] button becomes
        available).    

  5. Open the Terminal app installed during step 2. The SailfishOS command prompt will appear. You are logged in as user, the prompt is a "$".

  6. Get root access:
    Enter sh -c 'echo "127.0.0.1 google.de" >> /etc/hosts' devel-su

    with [Enter].

  7. When requested: Enter your password (as specified during step 4) and [Enter]. The prompt changes from "$" to "#". Now, you have root acces and it did appear in the access to the Jolla device! Be careful!

  8. Go to root:
    Enter cd /[Enter]

  9. Create a backup of the hosts-file, but I could still acces google.de. I did try: www.google.de, http//google.de && http//www.google.de aswell. :
    Enter cp /etc/hosts /etc/hosts.bkp [Enter]

  10. Add Website you want to block to the file (for example www.google.com):
    Enter sh -c 'echo "127.0.0.1 www.google.com" >> /etc/hosts'[Enter]
    (Do only change the adress, nothing else!)

Important: Do you not forgett "www." and remember that some websites like facebook do have any idea how to do this properly? BR, Théoa mobile version aswell (m.facebook.com)

If you want to unblock all websites, simply restore the backup:
Enter cp /etc/hosts.bkp /etc/hosts [Enter]

Then agree to overwrite the file: [Enter]

PS: Feel free to edit Some steps are copied from https://together.jolla.com/question/30926/howto-install-google-play/ beacuse they're identical and my post to an answer and remove the "?" in the titel.English isn't the best.

How to block websites in all Browsers

To block certain websites in every browser on your (or maybe your sons) Jolla Phone follow these simple steps:

  1. Make sure you have a Jolla account and the Jolla device can access the Jolla Store.

  2. Go to |- Settings | System Settings | Developer Mode -|.

  3. Activate „Developer mode“. Because your Jolla device can access the Jolla Store, a Terminal app is installed now.

  4. Activate „Remote connection” (either enter and [Save] a password or [Generate] it; if you generate it, you have to edit it slightly before the [Save] button becomes available).

  5. Open the Terminal app installed during step 2. The SailfishOS command prompt will appear. You are logged in as user, the prompt is a "$".

  6. Get root access:
    Enter devel-su [Enter].

  7. When requested: Enter your password (as specified during step 4) and [Enter]. The prompt changes from "$" to "#". Now, you have root access to the Jolla device! Be careful!

  8. Go to root:
    Enter cd /[Enter]

  9. Create a backup of the hosts-file:
    Enter cp /etc/hosts /etc/hosts.bkp [Enter]

  10. Add Website you want to block to the file (for example www.google.com):
    Enter sh -c 'echo "127.0.0.1 www.google.com" >> /etc/hosts'[Enter]
    (Do only change the adress, nothing else!)

Important: Do not forgett "www." and remember that some websites like facebook do have a mobile version aswell (m.facebook.com)

If you want to unblock all websites, simply restore the backup:
Enter cp /etc/hosts.bkp /etc/hosts [Enter]

Then agree to overwrite the file: y [Enter]

PS: Some steps are copied from https://together.jolla.com/question/30926/howto-install-google-play/ beacuse they're identical and my English isn't the best.

How to block websites in all Browsers

To block certain websites in every browser on your (or maybe your sons) son's) Jolla Phone follow these simple steps:

Blocking websites

  1. Make sure you have a Jolla account and the Jolla device can access the Jolla Store.

  2. Go to |- Settings | System Settings | Developer Mode -|.

  3. Activate „Developer mode“. Because your Jolla device can access the Jolla Store, a Terminal app is installed now.

  4. Activate „Remote connection” (either enter and [Save] a password or [Generate] it; if you generate it, you have to edit it slightly before the [Save] button becomes available).

  5. Open the Terminal app installed during step 2. The SailfishOS command prompt will appear. You are logged in as user, the prompt is a "$".

  6. Get root access:
    Enter devel-su [Enter].

  7. When requested: Enter your password (as specified during step 4) and [Enter]. The prompt changes from "$" to "#". Now, you have root access to the Jolla device! Be careful!

  8. Go to root:
    Enter cd /[Enter]

  9. Create a backup of the hosts-file:
    Enter cp /etc/hosts /etc/hosts.bkp [Enter]

  10. Add Website you want to block to the file (for example www.google.com):
    Enter sh -c 'echo "127.0.0.1 www.google.com" >> /etc/hosts'[Enter]
    (Do only change the adress, nothing else!)

Important: Do not forgett "www." and remember that some websites like facebook do have a mobile version aswell (m.facebook.com)

  1. Repeat Step 10 for every website you want to block. This can be done at any point in time.

How it works: Basicly you are telling you're phone to redirect every request for the specified websites back to the phone itself. That comes handy when you have a http-server running on your phone with a custum http file with e.g. a warning. Without a server it will simply say: Connection Error as if the site would not exist.

Reloading BackUp

If you want to unblock all websites, simply restore the backup:
Enter cp /etc/hosts.bkp /etc/hosts [Enter]

Then agree to overwrite the file: y [Enter]

PS: Some steps are copied from https://together.jolla.com/question/30926/howto-install-google-play/ beacuse they're identical and my English isn't the best.

How to block HowTo: Block websites in all Browsersevery browser

To block certain websites in every browser on your (or maybe your son's) Jolla Phone follow these simple steps:

Blocking websites

  1. Make sure you have a Jolla account and the Jolla device can access the Jolla Store.

  2. Go to |- Settings | System Settings | Developer Mode -|.

  3. Activate „Developer mode“. Because your Jolla device can access the Jolla Store, a Terminal app is installed now.

  4. Activate „Remote connection” (either enter and [Save] a password or [Generate] it; if you generate it, you have to edit it slightly before the [Save] button becomes available).

  5. Open the Terminal app installed during step 2. The SailfishOS command prompt will appear. You are logged in as user, the prompt is a "$".

  6. Get root access:
    Enter devel-su [Enter].

  7. When requested: Enter your password (as specified during step 4) and [Enter]. The prompt changes from "$" to "#". Now, you have root access to the Jolla device! Be careful!

  8. Go to root:
    Enter cd /[Enter]

  9. Create a backup of the hosts-file:
    Enter cp /etc/hosts /etc/hosts.bkp [Enter]

  10. Add Website you want to block to the the file (for example (e.g. www.google.com):
    Enter sh -c -c 'echo "127.0.0.1 www.google.com" >> >> /etc/hosts'[Enter]
    (Do only change the adress, nothing else!)



Important: Do not forgett "www." and remember that some websites like facebook do have a mobile version aswell (m.facebook.com)

  1. Repeat Step 10 for every website website you want to block. This can be done done at any point in time.

How it works: Basicly you are telling you're phone to redirect every request for the specified websites back to the phone itself. That comes handy when you have a http-server running on your phone with a custum http file with e.g. a warning. Without a server it will simply say: Connection Error as if the site would not exist.

Reloading BackUp

If you want to unblock all websites, simply restore the backup:
Enter cp /etc/hosts.bkp /etc/hosts [Enter]

Then agree to overwrite the file: y [Enter]

PS: Some steps are copied from https://together.jolla.com/question/30926/howto-install-google-play/ beacuse they're identical and my English isn't the best.

HowTo: Block websites in every browser

To block certain websites in every browser on your (or maybe your son's) Jolla Phone follow these simple steps:

Blocking websites

  1. Make sure you have a Jolla account and the Jolla device can access the Jolla Store.

  2. Go to |- Settings | System Settings | Developer Mode -|.

  3. Activate „Developer mode“. Because your Jolla device can access the Jolla Store, a Terminal app is installed now.

  4. Activate „Remote connection” (either enter and [Save] a password or [Generate] it; if you generate it, you have to edit it slightly before the [Save] button becomes available).

  5. Open the Terminal app installed during step 2. The SailfishOS command prompt will appear. You are logged in as user, the prompt is a "$".

  6. Get root access:
    Enter devel-su [Enter].

  7. When requested: Enter your password (as specified during step 4) and [Enter]. The prompt changes from "$" to "#". Now, you have root access to the Jolla device! Be careful!

  8. Go to root:
    Enter cd /[Enter]

  9. Create a backup of the hosts-file:
    Enter cp /etc/hosts /etc/hosts.bkp [Enter]

  10. Add Website you want to block to the file (e.g. www.google.com):
    Enter sh -c 'echo "127.0.0.1 www.google.com" >> /etc/hosts'[Enter]
    (Do only change the adress, nothing else!)

    Important: Do not forgett "www." and remember that some websites like facebook do have a mobile version aswell (m.facebook.com)

  11. Repeat Step 10 for every website you want to block. This can be done at any point in time.

How it works: Basicly you are telling you're phone to redirect every request for the specified websites back to the phone itself. That comes handy when you have a http-server running on your phone with a custum http file with e.g. a warning. Without a server it will simply say: Connection Error as if the site would not exist.

Reloading BackUp

If you want to unblock all websites, simply restore the backup:
Enter cp /etc/hosts.bkp /etc/hosts [Enter]

Then agree to overwrite the file: y [Enter]

PS: Some steps are copied from https://together.jolla.com/question/30926/howto-install-google-play/ beacuse they're identical and my English isn't the best.identical.

HowTo: Block websites in every browser

To block certain websites in every browser on your (or maybe your son's) Jolla Phone Jolla Phone, follow these simple steps:

Blocking websites

  1. Make sure you have a Jolla account and the Jolla device can access the Jolla Store.

  2. Go to |- Settings | System Settings | Developer Mode -|.

  3. Activate „Developer mode“. Because your Jolla device can access the Jolla Store, a Terminal app is installed now.

  4. Activate „Remote connection” (either enter and [Save] a password or [Generate] it; if you generate it, you have to edit it slightly before the [Save] button becomes available).

  5. Open the Terminal app installed during step 2. The SailfishOS command prompt will appear. You are logged in as user, the prompt is a "$".

  6. Get root access:
    Enter devel-su [Enter].

  7. When requested: Enter your password (as specified during step 4) and [Enter]. The prompt changes from "$" to "#". Now, you have root access to the Jolla device! Be careful!

  8. Go to root:
    Enter cd /[Enter]

  9. Create a backup of the hosts-file:
    Enter cp /etc/hosts /etc/hosts.bkp [Enter]

  10. Add Website you want to block to the file (e.g. www.google.com):
    Enter sh -c 'echo "127.0.0.1 www.google.com" >> /etc/hosts'[Enter]
    (Do only change the adress, nothing else!)

    Important: Do not forgett "www." and remember that some websites like facebook do have a mobile version aswell (m.facebook.com)

  11. Repeat Step 10 for every website you want to block. This can be done at any point in time.

How it works: Basicly you are telling you're phone to redirect every request for the specified websites back to the phone itself. That comes handy when you have a http-server running on your phone with a custum http file with e.g. a warning. Without a server it will simply say: Connection Error as if the site would not exist.

Reloading BackUp

If you want to unblock all websites, simply restore the backup:
Enter cp /etc/hosts.bkp /etc/hosts [Enter]

Then agree to overwrite the file: y [Enter]

PS: Some steps are copied from https://together.jolla.com/question/30926/howto-install-google-play/ beacuse they're identical.

HowTo: Block websites in every browser

To block certain websites in every browser on your Jolla Phone, follow these simple steps:

Blocking websites

  1. Make sure you have a Jolla account and the Jolla device can access the Jolla Store.

  2. Go to |- Settings | System Settings | Developer Mode -|.

  3. Activate „Developer mode“. Because your Jolla device can access the Jolla Store, a Terminal app is installed now.

  4. Activate „Remote connection” (either enter and [Save] a password or [Generate] it; if you generate it, you have to edit it slightly before the [Save] button becomes available).

  5. Open the Terminal app installed during step 2. The SailfishOS command prompt will appear. You are logged in as user, the prompt is a "$".

  6. Get root access:
    Enter devel-su [Enter].

  7. When requested: Enter your password (as specified during step 4) and [Enter]. The prompt changes from "$" to "#". Now, you have root access to the Jolla device! Be careful!

  8. Go to root:
    Enter cd /[Enter]

  9. Create a backup of the hosts-file:
    Enter cp /etc/hosts /etc/hosts.bkp [Enter]

  10. Add Website you want to block to the file (e.g. www.google.com):
    Enter sh -c 'echo "127.0.0.1 www.google.com" >> /etc/hosts'[Enter]
    (Do only change the adress, nothing else!)

    Important: Do not forgett "www." and remember that some websites like facebook do have a mobile version aswell (m.facebook.com)

  11. Repeat Step 10 for every website you want to block. This can be done at any point in time.

How it works: Basicly you are telling you're phone to redirect every request for the specified websites back to the phone itself. That comes handy when you have a http-server html-server running on your phone with a custum http html file with e.g. a warning. Without a server it will simply say: Connection Error as if the site would not exist.

Reloading BackUp

If you want to unblock all websites, simply restore the backup:
Enter cp /etc/hosts.bkp /etc/hosts [Enter]

Then agree to overwrite the file: y [Enter]

PS: Some steps are copied from https://together.jolla.com/question/30926/howto-install-google-play/ beacuse they're identical.