Webhook on client query #3662
-
Hello, first of all, let me tell you I simply love AdGuardHome, impressive piece of sw, very reliable and simple to use (one exec and one config file) and with a nice GUI. Congrats to all devs, keep up the great job. I want to achieve something that seems out-of-scope for a dns server, but maybe AdGuardHome can allow me to do it:
So questions are:
Thanks for any help or advice, Alessandro |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
AGH does not support webhooks, at least not at this moment. But I think this is indeed possible using the API. You'll need to poll the query log (rather often, every second maybe?) for new records and look for this domain there. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the answer. I wanted to avoid polling. I'll wait for webhooks to be available. |
Beta Was this translation helpful? Give feedback.
-
FWIW: Here is a home assistant configuration example I use to wake up my NAS on DNS query: # configuration.yaml
sensor:
- platform: rest
name: "Last DNS Query (nas.mydomain.com)"
resource: "http://<ADGUARD_SERVER_IP>/control/querylog?search=nas.mydomain.com&limit=1"
authentication: basic
username: "<USERNAME>"
password: "<PASSWORD>"
scan_interval: 5
value_template: "{{ value_json.oldest }}"
unique_id: "<UUID>" # template binary sensor state template
{{ now() - states('sensor.last_dns_query_nas_mydomain_com') | as_datetime(default=0) < timedelta(seconds=11) }} |
Beta Was this translation helpful? Give feedback.
-
Hello! I integrate software for a living. Web hooks, pollers, you name it. One of my users asked me to add an AdGuard Home integration. Being unfamiliar with the software, I stuck "AdGuard webhooks" into google and found my way here. I'd like to point out two things. Forgive my bluntness.
In the meantime, we'll try to learn your api and figure out how to integrate with it remotely (since the developers do not run this software). Cheers. |
Beta Was this translation helpful? Give feedback.
AGH does not support webhooks, at least not at this moment. But I think this is indeed possible using the API. You'll need to poll the query log (rather often, every second maybe?) for new records and look for this domain there.