I'm trying to setup Pi-Hole with LEDE in my home network. After some search on the forum/google I've tried a lot of things with no luck and I'm very frustrated.
As far I could understand, one of the best options is to set DNS server to clients via dnsmasq using dhcp-option
but none of my DHCP clients seems to asign that DNS server.
My actual dhcp
configuration looks like:
config dnsmasq
option domainneeded '1'
option boguspriv '1'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option expandhosts '1'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.auto'
option localservice '1'
option nonwildcard '0'
option local '/local/'
option domain 'local'
config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
list dhcp_option '6,192.168.1.145'
list dhcp_option '6,192.168.1.1'
config dhcp 'wan'
option interface 'wan'
option ignore '1'
config host
option name 'raspberrypi2'
option ip '192.168.1.3'
option mac 'xx:xx:xx:xx:xx:xx'
After restart dnsmasq
service I coud see this config file is loaded:
# auto-generated config file from /etc/config/dhcp
conf-file=/etc/dnsmasq.conf
dhcp-authoritative
domain-needed
localise-queries
read-ethers
bogus-priv
expand-hosts
local-service
domain=local
server=/local/
dhcp-leasefile=/tmp/dhcp.leases
resolv-file=/tmp/resolv.conf.auto
stop-dns-rebind
rebind-localhost-ok
dhcp-broadcast=tag:needs-broadcast
addn-hosts=/tmp/hosts
conf-dir=/tmp/dnsmasq.d
user=dnsmasq
group=dnsmasq
dhcp-host=xx:xx:xx:xx:xx:xx,192.168.1.3,raspberrypi2
dhcp-range=lan,192.168.1.100,192.168.1.249,255.255.255.0,12h
dhcp-option=lan,6,192.168.1.145
dhcp-option=lan,6,192.168.1.1
no-dhcp-interface=pppoe-wan
But when I issue dig
command in a dhcp client I'm getting:
# dig google.es
; <<>> DiG 9.11.2 <<>> google.es
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20298
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;google.es. IN A
;; ANSWER SECTION:
google.es. 299 IN A 216.58.201.131
;; Query time: 51 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Tue Oct 03 12:43:16 CEST 2017
;; MSG SIZE rcvd: 54
What I'm doing wrong ?
Regards.