by Tdarcos » Mon May 22, 2017 6:55 pm
Ice Cream Jonsey wrote:The next Pi project I want to outline is PiHole. PiHole works as a DNS service for your home computers, and it blocks ads from getting in.
Well, for technical people like us that's okay as long as your PI is set to ask for a DHCP server from your ISP and it knows to cache the real DNS server address so addresses it doesn't have will be looked up. You also need to edit the DNS configuration on your machine to static instead of using the default one your router gives you when you get your DHCP lease. Here's a page on how to do that:
http://www.geeksquad.co.uk/articles/how ... windows-10
One thing I have done is change the tables in my wireless router to tie the MAC address to the 192.168.0.X address every regular device in my house normally uses so they are essentially given permanent IP addresses. You should do this with the PI - make its IP address fixed in your router - so you can set the domains to exclude to use the IP address of the PI, and thus use its webserver, as | explain below.
In the interim until you get around to that or as an alternative there is another fairly easy method. You could just put all the names you want to exclude in the hosts file on each computer, c:\Windows\System32\Drivers\etc\hosts and make that shared writable, then use one computer as the reference source and copy that file to the others every time you add a new item. Any domains you want to block, set them to 127.0.0.1, since your machine isn't running a web server, they get fast no resolve responses.
There are publicly available hosts files that have thousands of ad, junk, spam, malware and garbage sites preloaded so that you can't even accidentally connect to some of these. And they simply redirect the names to 127.0.0.1.
Another idea is if you do put in a PI DNS server to do this with the hosts file on the pi, and find if there is a "fake web server" program that simply returns an empty page for any request, or possibly an Apache config file that has been set up with a blank page for its 404 page; every request for everything 404s to the 0 byte page. Much faster than waiting for DNS timeout |(if you're diverting to an invalid address) or a no response ()if you divert to a real address not running a web server).
[quote="Ice Cream Jonsey"]The next Pi project I want to outline is PiHole. PiHole works as a DNS service for your home computers, and it blocks ads from getting in.[/quote]
Well, for technical people like us that's okay as long as your PI is set to ask for a DHCP server from your ISP and it knows to cache the real DNS server address so addresses it doesn't have will be looked up. You also need to edit the DNS configuration on your machine to static instead of using the default one your router gives you when you get your DHCP lease. Here's a page on how to do that:
http://www.geeksquad.co.uk/articles/how-to-change-your-dns-windows-10
One thing I have done is change the tables in my wireless router to tie the MAC address to the 192.168.0.X address every regular device in my house normally uses so they are essentially given permanent IP addresses. You should do this with the PI - make its IP address fixed in your router - so you can set the domains to exclude to use the IP address of the PI, and thus use its webserver, as | explain below.
In the interim until you get around to that or as an alternative there is another fairly easy method. You could just put all the names you want to exclude in the hosts file on each computer, c:\Windows\System32\Drivers\etc\hosts and make that shared writable, then use one computer as the reference source and copy that file to the others every time you add a new item. Any domains you want to block, set them to 127.0.0.1, since your machine isn't running a web server, they get fast no resolve responses.
There are publicly available hosts files that have thousands of ad, junk, spam, malware and garbage sites preloaded so that you can't even accidentally connect to some of these. And they simply redirect the names to 127.0.0.1.
Another idea is if you do put in a PI DNS server to do this with the hosts file on the pi, and find if there is a "fake web server" program that simply returns an empty page for any request, or possibly an Apache config file that has been set up with a blank page for its 404 page; every request for everything 404s to the 0 byte page. Much faster than waiting for DNS timeout |(if you're diverting to an invalid address) or a no response ()if you divert to a real address not running a web server).