Support section for FREESCO v0.4.x 3rd Party Packages


Postby strampke » Tue Jul 19, 2011 2:06 pm

I did install hosts 10.x and of course it works

I did some restrict.cfg work on blocking hotmail, facebook etc. during working hours.
What I want to do now is to discourage some staff members to visit some sites.
I'd like to distract them to another site.
For instance a visit to will be redirected to

Of course I can use the hosts package, but I want to do some small redirection work.

How do I set up an /etc/hosts file that survives a reboot
Who knows knows, who doesn't doesn't.
User avatar
Junior Advanced Member
Posts: 151
Joined: Mon Jul 29, 2002 12:36 pm
Location: Delden, Netherlands

Re: hosts

Postby Lightning » Tue Jul 19, 2011 7:06 pm

How do I set up an /etc/hosts file that survives a reboot
The file that you really want to edit is the /etc/dns.cfg and then copy it to /boot/etc/

The dns.cfg file is copied into the top of the hosts file every time you start or restart the DNS server.

Also as a means of control for specific sites it is possible to use a redirect firewall rule to a server on FREESCO. This was something that I have done and it did work pretty well with a combination of firewall rules, the built in web server and DNS control. The key to really making it work is to create a 401.html file in the /www/error/ directory of the web server and making that same page the index.html in /www so that no matter what the name of the page was asked for it would always be displayed and the URL was always re-directed to a specific IP that was defined in the dns.cfg and that IP was entered with a redirect firewall rule to the web server local port. It is also required to run the DNS server in 'e' (Exclusive) mode so that no other DNS servers can be used by the clients even if they configure them manually.

In fact redirect is already a feature option in 0.4.3 systems and newer using the /etc/restrict.cfg and preceding the line with 'rpl' ( Redirect Port Locally). That way it can also be time based when the rule should be in place. The problem with that specific option is that it is just port specific and not IP or URL specific. That is why it takes a few custom rules with the -D destination defined to make it IP specific.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Posts: 12081
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Return to 3rd Party Package Support for FREESCO v0.4.x

Who is online

Users browsing this forum: No registered users and 1 guest