DHCP clients not getting proper DNS entry

I have DHCP setup and I've configured DNS forwardings to point to my Pi-hole server but my DHCP clients all just use the gateway as DNS.

DNS forwardings 10.10.1.2

Default Gateway . . . . . . . . . : 10.10.1.1
DHCP Server . . . . . . . . . . . : 10.10.1.1
DNS Servers . . . . . . . . . . . : 10.10.1.1

Any idea how to fix this?

Are you clients Android devices? These use Google's DNS, independent of DHCP configuration.

1 Like

No it's my laptop

Sorry, I did not read the "just use the gateway as DNS" part of your message; I see two options here:

  1. Configure DNSMASQ in the router to announce the PiHole as a DNS on the DHCP.
  2. Continue using the router as a DNS, but forward all requests to the PiHole.

Which one do you prefer?

1 Like

I'd like DNSMASQ to announce Pi-hole because it will keep better stats then. Otherwise Pi-hole just sees everything coming from 10.10.1.1.

Have a look at this link, I think it covers your needs:
https://wiki.openwrt.org/doc/uci/dhcp#enabling_dhcp_without_enabling_dns

Great info!! I didn't know it!!

So it took some tinkering but this is what I ended up with working.

root@LEDE:~# cat /etc/config/dhcp

config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        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 port '0'**

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option leasetime '12h'
        option limit '100'
        **list dhcp_option '6,10.10.1.2'**

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
1 Like