Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
redhat:ip-address-services-redhat:configure-bind-with-adblocking-redhat [2017/09/29 15:21] – [Let's Get Started!] michael | redhat:ip-address-services-redhat:configure-bind-with-adblocking-redhat [2018/05/16 11:08] (current) – [Let's Get Started!] michael | ||
---|---|---|---|
Line 23: | Line 23: | ||
# vim / | # vim / | ||
- | <sxh bash>acl " | + | <sxh bash highlight: [2, 16, 29-30, 48-51]>acl " |
172.16.1.0/ | 172.16.1.0/ | ||
}; | }; | ||
Line 86: | Line 86: | ||
- **Lastly**, you will need to '' | - **Lastly**, you will need to '' | ||
- | <sxh bash;> | + | <sxh bash;> |
type master; | type master; | ||
- | file "blitz.home.zone"; | + | file "blackgate.home.zone"; |
};</ | };</ | ||
</ | </ | ||
- | ==== Installation von Updates und Voraussetzungen ==== | + | |
<WRAP center | <WRAP center | ||
- | ==== Installation von Updates und Voraussetzungen | + | ==== Erstellen der ad-block Zone ==== |
+ | |||
+ | < | ||
+ | |||
+ | <sxh bash; highlight: [2, 9];>$TTL 86400 | ||
+ | @ | ||
+ | 2016010100 | ||
+ | 21600 ; refresh after 6 hours | ||
+ | 3600 ; retry after 1 hour | ||
+ | 604800 | ||
+ | 86400 | ||
+ | |||
+ | IN NS dns01.domain.local. | ||
+ | |||
+ | @ | ||
+ | * | ||
+ | </ | ||
+ | |||
+ | '' | ||
+ | - In the second line, you will need to update to your domain. As example, you would want to set it to: '' | ||
+ | - Then you will need to change dns01.domain.local to the domain name of this server (dns01, in my example) you will need to update line 9 as well, to someting like: '' | ||
- | < | ||
</ | </ | ||
+ | |||
+ | |||
+ | <WRAP center | ||
+ | ==== Erstellen der DNS lokalen Forward Zone ==== | ||
+ | '' | ||
+ | |||
+ | < | ||
+ | |||
+ | <sxh bash; highlight: [2, 9, 11-12]> | ||
+ | @ | ||
+ | 2015122100 | ||
+ | 21600 ; refresh after 6 hours | ||
+ | 3600 ; retry after 1 hour | ||
+ | 604800 | ||
+ | 86400 | ||
+ | |||
+ | IN NS dns01.domain.local. | ||
+ | |||
+ | dns01 | ||
+ | fw01 IN A | ||
+ | dns | ||
+ | </ | ||
+ | |||
+ | '' | ||
+ | |||
+ | Down toward the end of the file I have two examples of how to manually add DNS records (A records). Just use this same format if you want to add any of your own. The bottom line is for creating a CNAME record for dns, and pointing it to my server named dns01. If this server is not named dns01 for you, replace dns01 with the correct name. | ||
+ | |||
+ | Now if you ever go back and update this file (which is normal), update the serial (line 3) so named will know to reread this file since it's been updated. | ||
+ | |||
+ | The serial is 10 digits, and is best used in a date format '' | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | <WRAP center | ||
+ | ==== Herunterladen des AD-Blacklist Zonen Files ==== | ||
+ | '' | ||
+ | |||
+ | < | ||
+ | # wget -O / | ||
+ | </ | ||
+ | |||
+ | |||
+ | <WRAP center | ||
+ | ==== Konfiguration des DNS lokalen HTTPD ==== | ||
+ | |||
+ | < | ||
+ | |||
+ | Above we downloaded the 1x1 transparent gif file that we'll serve up instead of ads. Next we need to update the httpd config with rewrite rules to know when/how to serve the file. We need to open the file for editing, and just add in a few lines inside the < | ||
+ | |||
+ | < | ||
+ | |||
+ | <sxh bash;>< | ||
+ | Header set Cache-Control " | ||
+ | </ | ||
+ | |||
+ | RewriteEngine On | ||
+ | RewriteBase / | ||
+ | RewriteCond %{REQUEST_FILENAME} !-f | ||
+ | RewriteCond %{REQUEST_FILENAME} !-d | ||
+ | RewriteCond %{REQUEST_FILENAME} !-l | ||
+ | RewriteRule ^(.*)$ http:// | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | <WRAP center | ||
+ | ==== Konfiguration Firewalld, sowie Starten und enablen der Services ==== | ||
+ | |||
+ | < | ||
+ | # firewall-cmd --permanent --add-port=53/ | ||
+ | # firewall-cmd --permanent --add-port=53/ | ||
+ | # firewall-cmd --permanent --add-service=http | ||
+ | # firewall-cmd --reload | ||
+ | |||
+ | # systemctl reboot | ||
+ | </ | ||
+ | |||
+ | From here you just need to configure your client computer to use this server as it's DNS server, and you should then be ad free! If it's not working right, or you're having problem, just me know and I'd be glad to help out! | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | '' | ||