« Unbound - Pihole » : différence entre les versions
Aucun résumé des modifications |
|||
| Ligne 15 : | Ligne 15 : | ||
* http://gregoryborysiak.blogspot.com/2015/04/configurer-unbound-sur-raspberry-pi.html | * http://gregoryborysiak.blogspot.com/2015/04/configurer-unbound-sur-raspberry-pi.html | ||
< | <syntaxhighlight lang="bash" line> | ||
/etc/unbound/unbound.conf.d | # /etc/unbound/unbound.conf.d | ||
sudo service unbound restart | sudo service unbound restart | ||
unbound-checkconf | unbound-checkconf | ||
</syntaxhighlight> | |||
#logrotate | <syntaxhighlight lang="bash" line> | ||
# logrotate | |||
touch /var/log/unbound.log | touch /var/log/unbound.log | ||
sudo chmod 640 /var/log/unbound.log | sudo chmod 640 /var/log/unbound.log | ||
sudo chown unbound:unbound /var/log/unbound.log | sudo chown unbound:unbound /var/log/unbound.log | ||
</syntaxhighlight> | |||
<pre> | |||
/var/log/unbound.log | /var/log/unbound.log | ||
{ | { | ||
| Ligne 39 : | Ligne 42 : | ||
endscript | endscript | ||
} | } | ||
</pre> | |||
#forcer logrotate | <syntaxhighlight lang="bash" line> | ||
# forcer logrotate | |||
sudo logrotate -f /etc/logrotate.d/unbound | sudo logrotate -f /etc/logrotate.d/unbound | ||
</ | </syntaxhighlight> | ||
* https://docs.pi-hole.net/guides/dns/unbound/ | * https://docs.pi-hole.net/guides/dns/unbound/ | ||
* https://echolib.in/raspberry-installer-pi-hole-unbound | * https://echolib.in/raspberry-installer-pi-hole-unbound | ||
| Ligne 87 : | Ligne 90 : | ||
* https://mediacenterz.com/tutoriel-complete-pi-hole-bloqueur-dannonces-pour-toute-la-maison/ | * https://mediacenterz.com/tutoriel-complete-pi-hole-bloqueur-dannonces-pour-toute-la-maison/ | ||
<syntaxhighlight lang="bash" line | <syntaxhighlight lang="bash" line> | ||
#mise à jour pihole car pas apt | #mise à jour pihole car pas apt | ||
pihole -up (le repertoire admin doit se trouver ds /var/www/html) | pihole -up #(le repertoire admin doit se trouver ds /var/www/html) | ||
# relancer | # relancer | ||
| Ligne 101 : | Ligne 104 : | ||
pihole -q -adlist -exact facebook.com | pihole -q -adlist -exact facebook.com | ||
</syntaxhighlight> | |||
pihole status | <syntaxhighlight lang="bash" line> | ||
sudo netstat -nltup | grep 'Proto\|:53 \|: | #pihole status | ||
sudo netstat -nltup | grep 'Proto\|:53 \|:8082 \|:80 \|:5335 \|:443 \|:51820' | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| Ligne 158 : | Ligne 163 : | ||
=== BDD de pihole === | === BDD de pihole === | ||
<syntaxhighlight lang="bash" line | <syntaxhighlight lang="bash" line> | ||
#sqlite3 | #sqlite3 | ||
/etc/pihole/pihole-FTL.db | /etc/pihole/pihole-FTL.db | ||
| Ligne 185 : | Ligne 190 : | ||
=== update pihole === | === update pihole === | ||
< | <span style="color: red;font-weight:bold;">pihole -up</span> | ||
pihole -up | |||
</ | |||
=== Contrôle parental === | === Contrôle parental === | ||
| Ligne 201 : | Ligne 204 : | ||
En remplacement de unbound sur 127.0.0.1#5053 | En remplacement de unbound sur 127.0.0.1#5053 | ||
: [https://pimylifeup.com/rapberry-pi-dns-over-https/ install cloudflared et utliser par exemple quad9] | : [https://pimylifeup.com/rapberry-pi-dns-over-https/ install cloudflared et utliser par exemple quad9] | ||
== sqllite3 == | |||
<syntaxhighlight lang="bash" line> | |||
sqllite3 | |||
sqlite> .open pihole-FTL.db | |||
# voir les tables | |||
sqlite> SELECT name FROM sqlite_master WHERE type = "table"; | |||
#nom des colonnes d'une table | |||
PRAGMA table_info(tablename); | |||
</syntaxhighlight> | |||
* Vérifier nombre d'élements à supprimer | |||
<syntaxhighlight lang="sql" line> | |||
SELECT COUNT(*) FROM query_storage | |||
WHERE EXISTS | |||
( SELECT * | |||
FROM domain_by_id | |||
WHERE query_storage.domain = domain_by_id.id AND domain_by_id.domain LIKE '%lb._dns-sd._udp.0.10.168.192.in-addr.arpa%'); | |||
DELETE FROM query_storage | |||
WHERE EXISTS | |||
( SELECT * | |||
FROM domain_by_id | |||
WHERE query_storage.domain = domain_by_id.id AND domain_by_id.domain LIKE '%lb._dns-sd._udp.0.10.168.192.in-addr.arpa%'); | |||
</syntaxhighlight> | |||
[[Catégorie: Raspian]] | [[Catégorie: Raspian]] | ||