Howto setup custom DNS (ipv6) for specific clients


Im trying to use pi-hole adblocking dns server for some android base mobile devices. The problem I am having is that the android device has the ipv6 dns as the primary resolver and ipv4 as the backup resolver on the android device. The ipv6 resolver still points to the LEDE router instead of the pi-hole dns server.

I made the following configuration that seems to work for ipv4. But I cant seem to find how to configure this for ipv6. I tried the options commented out based on the dnsmasq documentation to no avail (resulting in invalid configuration).

config tag 'pi_hole_dns'
        list dhcp_option '6,'
#        list dhcp_option 'option6:23,[fe80::...]'
#        list dhcp_option 'option6:dns-servers,[fe80::...]'

config host
        option name 'Android-Phone'
        option tag 'pi_hole_dns'

Cant find much in the official documentation on how to achieve this for ipv6.
I am on LEDE 17.01.4 r3560-79f57e422d

Any help is appreciated :slight_smile:

IPv6 is handled by odhcpd. IPv4 (and DNS) are handled by dnsmasq.

  • Is there a reason that your LEDE DNS server will not work?
  • Is there a reason that you cannot configure your LEDE's DNS server to use the Pi as it's upstream DNS server???

Right now I have dnscrypt as upstream. if I were to place pi-hole in between it would be used by all devices in the network. Also pi-hole runs on a different machine meaning I would have to open up dnscrypt to the outside (now it only listens on localhost).

I only want pi-hole to be used by specific clients (only android phone/tablet) where the chain is a follows pihole->lede->dnscrypt->... Other client will use LEDE directly as DNS server.