Tiny Core Base > CorePlus

How can i block modern usage of internet with this post exception?

<< < (2/2)

GNUser:
Hi cedm5cd. It sounds like you want a domain whitelist, which may be a bit tricky to implement (a blacklist would be simpler).

A naive solution is to put the domain names and ip addresses of the sites you want into /etc/hosts, so that it looks like this (add the other domains you want, one per line--there are many ways to get the ip address, simplest way is "nslookup blahblahblah.org"):


--- Code: ---127.0.0.1 box localhost localhost.local

kmeleonbrowser.org 216.105.38.10
tinycorelinux.net 128.127.66.77
msfn.org 151.106.17.234
--- End code ---

Then disable DNS by changing /etc/resolv.conf to this:

--- Code: ---nameserver 0.0.0.0

--- End code ---

You probably want to make /etc/resolv.conf immutable (to prevent network managers etc. from adding a dns server to it):

--- Code: ---sudo chattr +i /etc/resolv.conf

--- End code ---

You'd also need some mechanism to periodically update /etc/hosts, because the ip address associated with each domain may change.

Other users may have a better solution, but I think the above would work.



Rich:
Hi cedm5cd

--- Quote from: cedm5cd on February 16, 2026, 04:58:02 PM ---Did I do something to not be helped?
--- End quote ---
No.
Sometimes it takes a while for someone with an answer to respond.
Sometimes no knows the answer to someones question.

Navigation

[0] Message Index

[*] Previous page

Go to full version