Skip to content

Instantly share code, notes, and snippets.

@andersevenrud
Last active November 30, 2023 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andersevenrud/b86f2033d2e751766c92e41c1ddf8028 to your computer and use it in GitHub Desktop.
Save andersevenrud/b86f2033d2e751766c92e41c1ddf8028 to your computer and use it in GitHub Desktop.
Pi-Hole w/D-Link R15

Pi-Hole w/D-Link R15

A brief guide on how to set up Pi-Hole and make all clients on the network use it as DNS without any manual configuration on clients.

R15 is also known as EAGLE PRO AI AX1500 Smart Router

https://eu.dlink.com/no/nb/products/r15-eagle-pro-ai-ax1500-smart-router

Setting up Pi-Hole

There are so many alternatives here, but in my case I just set up a Docker container on a Raspberry Pi 4.

Installation

See https://pi-hole.net/ on how to install.

Set upstream DNS

In Settings -> DNS make sure you have both IP4 and IPv6 upstream DNS servers enabled.

Obtain IP address

To configure the router you need to obtain both the IPv4 and IPv6 address of the device running Pi-Hole.

You can do this by going into Tools -> Generate Debug Log and then from the log search for Network interfaces and addresses and locate the eth0 (if running on LAN) interface, i.e.:

   2: eth0: ...
          ...
       inet 192.168.0.108/24 brd 192.168.0.255 scope global dynamic noprefixroute eth0
          ...
       inet6 2001:4645:6e25:c:c11b:b7d:f195:82c8/64 scope global dynamic mngtmpaddr noprefixroute 
          ...

My IPv4 address is 192.168.0.108 and IPv6 is 2001:4645:6e25:c:c11b:b7d:f195:82c8

Setting up R15

Log into your router, i.e.: http://192.168.0.1

This involves a lot of waiting between steps, but minimal downtime.

Reserve IP address

First ensure that the IP address for your Pi-Hole device is reserved to ensure to ensure you don't have to re-do anything if your router for some reason clears DHCP information.

There is no way to do this for IPv6, so I have no idea of they will stay static. But it whould be based on the MAC address, which only changes if you use the MAC Address Clone feature under Settings -> Internet.

  1. Under Home Click on Connected Clients
  2. Click the pencil icon on the card containing the IP of your Pi-Hole
  3. Enable Reserve IP
  4. Enter the IPv4 address of your Pi-Hole into IP Address (Reserved)
  5. Save and wait

Disable DNS Relay

Having "DNS Relay" enabled will force all DNS requests to go through the router and not the machine running Pi-Hole.

  1. Go to Settings -> Network in the panel menu
  2. Under Network Settings disable Enable DNS Relay
  3. Save and wait

Modify DHCP Settings

First for IPv4:

  1. Go to Settings -> Internet in the panel menu
  2. Click Advanced Settings...
  3. Put your Pi-Hole IPv4 address into Primary DNS Server
  4. Leave Secondary DNS Server blank
  5. Make Sure Secure DNS is disabled
  6. Save and wait

Then for IPv6:

  1. Go back to the same panel menu item
  2. Now select the IPv6 tab
  3. Under DNS Type select Use the following DNS addresses
  4. Put your Pi-Hole IPv6 address into Primary DNS Server
  5. Leave Secondary DNS server blank
  6. Save and wait

Confirming changes

This should be immediately visible as the Pi-Hole dashboard starts to fill up with requests from all your devices.

Note that already connected devices might not have gotten a fresh DHCP lease eveh though changes were saved, so you might have to disconnect and reconnect connections physically.

You can confirm the settings via Network settings/details in your operating system. DNS should only show the IP adresses you configured in the router.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment