[RELEASE] AdGuard Home DNS Server and Client Manager

This is an app and drivers to manage AdGuard Home DNS Servers and their configured clients.

I created this package so that I could have a physical switch to block/unblock YouTube on my kid's devices.

Features:

  • Block/Unblock AGH built-in services
  • Enable/Disable
    • Protection
    • Filtering
    • Parental Control
    • Safe Search
    • Safe Browsing

Basic Instructions:
Install the App and Drivers with HPM.
The Client driver is not required if you only want to control global server settings.
Open the app then add your first server.
If you want to manage clients, be sure to create child devices from the app or server device.

HPM Manifest - https://raw.githubusercontent.com/JoKneeMo/hubitat/main/adguardhome/packageManifest.json

GitHub - hubitat/adguardhome at main · JoKneeMo/hubitat · GitHub

Screenshots:





5 Likes

This looks awesome. Much more advanced than I was planning on making it. All I really want is to be able to disable the protection easily and then set a timer to have it come back on automatically. Looks like this should do it in combination with a rule to turn it back on.

Update: When setting this up I put in my credentials wrong, also forgot to include the port with the IP. Might want to word it in a way something about Server IP:Port?

In the app part, I clicked on the newly added server and then it created a duplicate. After that I went to the device until I could refresh it with proper settings, then I went back and clicked on the server in the app. Looks to be working now.

This was with missing port

This was with wrong username

I'll update the IP text and and a credential check before creating the server.

The IP/hostname field will assume port 80 or 443 if TLS is enabled.

Does this require Adguard to run in a seperate device? Or just using the Adguard DNS?

This is only for if you are running your own local AdGuard Home server

2 Likes

Ahh ok. Im just dipping my toe in the adguard pool, but havent gotten that far. Just running the Adguard app on my phone and looking at the VPN.

What would i need to set up a home server?

Most of the docs are about linux setup. But I know you are on Windows only so I did find this page that has an installer to download. Once it is setup you have to redirect your devices to use it for DNS, easiest way is to set the DNS that the DCHP server hands out, usually on the router.

1 Like

You want it running on a device that is always on. Some people run it on a NAS (docker), some people on a rasberrypi, some run it right on a router (need something like openwrt, pfsense, etc..,), and some people run it on a computer that is always on.

I personally run it on a rasberrypi that is located where my router and switches are located. You will need to do some network configuration on your router after you set it up on whatever device you choose. This is fairly straightforward on most routers, but depending on the equipment you currently have it can be a little daunting.

As im getting deeper down this rabbit hole I'm starting to reevaluate my computer / network needs. I do have an unused AT&T Streaming box. I think it was running a flavor of Android TV. Ive often wondered if i couldnt repurpose it in some way.

I thinknit may bave been called an Osprey box?

@JoKneeMo, how do I create one or two client child devices? When I hit create child devices, it created a device for every one of my 220 devices in AdGuard... I didn't want to manually go through all of them and delete the ones I don't want, so I just hit the delete child devices and removed them all... Is there a way to just create specific child devices? I like your comment on controlling your kid's devices. That is exactly what I want to use this for. Don't need to have all the other home devices included... :slight_smile:

Currently the only why to accomplish this would be to manually remove the ones you don't want after creating all child devices.

When I have the time, I'll add a button on the server device to allow you to create a child by entering an IP address.

I'll post here when I get to that, but I've been rather busy.
I'd welcome a pull request on GitHub if someone is available to do it sooner.

@JoKneeMo

Thank you... I'm in no hurry and will probably wait until you or someone else can add this feature. I have multiple locations and servers all with the same list of clients... Going through and deleting all of those would take a lot of time... And the hub freaks out when adding that many new devices also... Kept prompting for doing a backup... :slight_smile:

Thanks for creating this! Very useful.

However, I have around 30ish clients on my network and only 3 show up when I created/refreshed the child devices. Is there any reason the other clients not showing up?

I must have done something wrong. I can see in Hubitat that it reports the correct status of Adguard home, but anything I tried to change (like turning protection on/off) on the Hubitat doesn't change the actually settings on Adguard side. The log shows error as follow

This could be really useful, but, alas, I use pfBlockerNG on a pfSense firewall. Wondering if anyone has adapted this, or made their own similar solution, for pfSense?

@Gergor
I believe I had a similar issue and modified line 349 in the AdGuardHome Server driver.

Original
headers.put("Content-type", "application/json; charset=UTF-8")

Modified
headers.put("Content-type", "application/json")

2 Likes

Works like a charm! Thx!!

@Gergor @mhensonjr

v1.0.1 was just released to fix this issue.
I'm not sure if it started after a Hubitat or AGH update.

You can update it from the Hubitat Package Manager.

1 Like

Hey sir,

Any chance of updating the child device add?

@SuperDupe Let me know if you have any issues.

AdGuard Home DNS Manager - v1.1.0

Feature Release


Driver-Server Changes

  • Added the ability to create a single DNS client child device
    This is useful when you have many clients on a server and don't want to add all of them to Hubitat.
    The command createSingleChild was added and accepts an ID string used in AGH for the client, ie. IP, MAC, or hostname
    The ID is then validated against the AGH server before it's added to Hubitat.

  • Fixed "null" value from being added to block lists on both Hubitat and AGH

Driver-Client Changes

  • Fixed "null" value from being added to block lists on both Hubitat and AGH

Full Changelog: v1.0.1...v1.1.0