hostingitall
Cadet
- Joined
- Oct 18, 2015
- Messages
- 4
Hello,
I have used a few guides around the web to install a DNS jail to filter web advertisements on my home network. Feel free to make and suggestions you feel I may be missing.
This is running FreeNAS 9.3.1
Open your FreeNAS page
Navigate to Jails and Click "Add Jail"
Give your Jail a name and click Advanced > Set a static IPv4 for your Jail and hit OK to create the Jail.
Once Jail is created click on "View Jails" click your Jail and launch the shell.
enter this command below in shell to edit rc.conf:
edit /etc/rc.conf
Navigate to the bottom of the screen and add these lines:
named_enable="YES"
named_chrootdir=""
You have completed this file hold ESC and press enter and save changes on quit.
--------------------------------------------------------------------------------
Now we are back at the shell screen use the command below to edit the named configuration
edit /var/named/etc/namedb/named.conf
Look for the following line
listen-on { 127.0.0.1; };
Change it to:
listen-on { any; };
Then go all the way to the bottom and add the following line:
include "/etc/namedb/adblock/adblock_include.conf";
You have completed this file hold ESC and press enter and save changes on quit.
--------------------------------------------------------------------------------
Now we are back at the shell screen use the command below to create the directory for adblocking:
mkdir /var/named/etc/namedb/adblock
Now we run the next commands grab the configuration and adblock config - I will host these forever on my site below.
fetch -o /var/named/etc/namedb/working/null.zone.file http://HostingItAll.com/FreeNAS/null.zone.file
fetch -o /var/named/etc/namedb/adblock/adblock_include.conf http://HostingItAll.com/FreeNAS/adblock_include.conf
Now we need to start your named service run the command below in shell:
service named start
Test your configuration by running the command below in shell:
dig @localhost ad.doubleclick.com
it should return 127.0.0.1
--------------------------------------------------------------------------------
Once verified working log into your home router and set your DNS server to use the IP address of your new jail.
You may need to do an IPCONFIG /FLUSHDNS in the cmd prompt using Windows machines to immediately purge out all your old DNS. - No absolute need as it will eventually update for everyone.
Note: You can add more blocked sites by editing the adblock_include.conf file and following the format, be sure to restart named for it to take effect.
I have used a few guides around the web to install a DNS jail to filter web advertisements on my home network. Feel free to make and suggestions you feel I may be missing.
This is running FreeNAS 9.3.1
Open your FreeNAS page
Navigate to Jails and Click "Add Jail"
Give your Jail a name and click Advanced > Set a static IPv4 for your Jail and hit OK to create the Jail.
Once Jail is created click on "View Jails" click your Jail and launch the shell.
enter this command below in shell to edit rc.conf:
edit /etc/rc.conf
Navigate to the bottom of the screen and add these lines:
named_enable="YES"
named_chrootdir=""
You have completed this file hold ESC and press enter and save changes on quit.
--------------------------------------------------------------------------------
Now we are back at the shell screen use the command below to edit the named configuration
edit /var/named/etc/namedb/named.conf
Look for the following line
listen-on { 127.0.0.1; };
Change it to:
listen-on { any; };
Then go all the way to the bottom and add the following line:
include "/etc/namedb/adblock/adblock_include.conf";
You have completed this file hold ESC and press enter and save changes on quit.
--------------------------------------------------------------------------------
Now we are back at the shell screen use the command below to create the directory for adblocking:
mkdir /var/named/etc/namedb/adblock
Now we run the next commands grab the configuration and adblock config - I will host these forever on my site below.
fetch -o /var/named/etc/namedb/working/null.zone.file http://HostingItAll.com/FreeNAS/null.zone.file
fetch -o /var/named/etc/namedb/adblock/adblock_include.conf http://HostingItAll.com/FreeNAS/adblock_include.conf
Now we need to start your named service run the command below in shell:
service named start
Test your configuration by running the command below in shell:
dig @localhost ad.doubleclick.com
it should return 127.0.0.1
--------------------------------------------------------------------------------
Once verified working log into your home router and set your DNS server to use the IP address of your new jail.
You may need to do an IPCONFIG /FLUSHDNS in the cmd prompt using Windows machines to immediately purge out all your old DNS. - No absolute need as it will eventually update for everyone.
Note: You can add more blocked sites by editing the adblock_include.conf file and following the format, be sure to restart named for it to take effect.
Last edited: