informatique:logiciels:dnsmasq

dnsmasq

Nom de la section

Consulter les logs des actions du service dnsmasq :

Jun 10 17:50:00 dnsmasq[21796]: query[A] isatap.lan from 115.34.22.160
Jun 10 17:50:00 dnsmasq[21796]: cached isatap.lan is NXDOMAIN-IPv4
Jun 10 17:50:21 dnsmasq[21796]: query[A] isatap.lan from 115.34.22.160
Jun 10 17:50:21 dnsmasq[21796]: cached isatap.lan is NXDOMAIN-IPv4
Jun 10 17:50:31 dnsmasq[21796]: query[A] isatap.lan from 115.34.22.160
Jun 10 17:50:31 dnsmasq[21796]: cached isatap.lan is NXDOMAIN-IPv4
Jun 10 17:50:37 dnsmasq[21796]: query[A] isatap.lan from 115.34.22.160
Jun 10 17:50:37 dnsmasq[21796]: cached isatap.lan is NXDOMAIN-IPv4
Jun 10 17:50:40 dnsmasq[21796]: query[A] zyx.qq.com from 115.34.22.160
Jun 10 17:50:40 dnsmasq[21796]: forwarded zyx.qq.com to 114.114.114.114
Jun 10 17:50:40 dnsmasq[21796]: forwarded zyx.qq.com to 223.5.5.5
Jun 10 17:50:40 dnsmasq[21796]: reply zyx.qq.com is 123.151.43.51
Jun 10 17:50:40 dnsmasq[21796]: reply zyx.qq.com is 183.60.62.158
Jun 10 17:50:40 dnsmasq[21796]: reply zyx.qq.com is 113.108.1.90
Jun 10 17:50:42 dnsmasq[21796]: query[A] isatap.lan from 115.34.22.160
Jun 10 17:50:42 dnsmasq[21796]: cached isatap.lan is NXDOMAIN-IPv4
Jun 10 17:50:52 dnsmasq[21796]: query[A] isatap.lan from 115.34.22.160
Jun 10 17:50:52 dnsmasq[21796]: cached isatap.lan is NXDOMAIN-IPv4
Jun 10 17:50:58 dnsmasq[21796]: query[A] ic.wps.cn from 115.34.22.160

Extraire une liste des noms de domaine demandés :

awk '!seen[$6]++ {print $6}' /var/log/syslog

Création d'un fichier de configuration spécifique dans /etc/dnsmasq.d/acegrp.conf

alias=8.8.8.8,192.168.100.1
 
listen-address=127.0.0.1,192.168.100.1
 
domain-needed
bogus-priv
filterwin2k
localise-queries
local=/acegrp.lan/
domain=acegrp.lan
expand-hosts
no-negcache
no-resolv
clear-on-reload
#resolv-file=/tmp/resolv.conf.auto
 
dhcp-authoritative
dhcp-leasefile=/tmp/dhcp.leases
 
# use /etc/ethers for static hosts; same format as --dhcp-host
read-ethers
 
# activez le serveur DHCP:
# Plage DHCP
dhcp-range=192.168.100.2,192.168.100.254,1h
# Netmask
dhcp-option=1,255.255.255.0
# Route
dhcp-option=3,192.168.100.254
dhcp-option=option:dns-server,192.168.100.3
 
#upstream
#server=192.168.100.3
#server=1.1.1.1
server=9.9.9.9

server permet d'indiquer le serveur upstream DNS. Il est nécessaire de l'indiquer car la consultation du fichier /etc/resolv.conf a été désactiver avec l'option no-resolv.

Entrer votre commentaire. La syntaxe wiki est autorisée:
Si vous ne pouvez pas lire le code, téléchargez ce fichier .wav pour l'écouter.
 
  • informatique/logiciels/dnsmasq.txt
  • Dernière modification: 2021/05/15 10:15
  • de Cédric ABONNEL