External DNS - Adguard Home Provider (Webhook)

The Adguard Home Provider Webhook for External DNS provides support for Adguard Home filtering rules.
The provider is hugely based on https://github.com/ionos-cloud/external-dns-ionos-webhook.
Supported DNS Record Types
The following DNS record types are supported:
A
AAAA
CNAME
TXT
SRV
NS
PTR
MX
Adguard Home Filtering Rules
The provider manages Adguard Home filtering rules following the Adguard specification, which allows this provider to - theoretically - support all kinds of DNS record types.
Each record will be added in the format ||DNS.NAME^dnsrewrite=NOERROR;RECORD_TYPE;TARGET #$managed-by-external-dns.
Examples are:
||my.domain.com^dnsrewrite=NOERROR;A;1.2.3.4 #$managed-by-external-dns
||my.domain.com^dnsrewrite=NOERROR;AAAA;1111:2222::3 #$managed-by-external-dns
The provider will also honour and not modify any manually created rules. The filter constraint is the $managed-by-external-dns comment.
Configuration
See cmd/webhook/init/configuration/configuration.go for all available configuration options of the webhook sidecar, and internal/adguard/configuration.go for all available configuration options of the Adguard provider.
Kubernetes Deployment
The Adguard webhook is provided as an OCI image in ghcr.io/muhlba91/external-dns-provider-adguard.
The following example shows the deployment as a sidecar container in the ExternalDNS pod using the Bitnami Helm charts for ExternalDNS.
helm repo add bitnami https://charts.bitnami.com/bitnami
# create the adguard configuration
kubectl create secret generic adguard-configuration --from-literal=url='<ADGUARD_URL>' --from-literal=user='<ADGUARD_USER>' --from-literal=password='<ADGUARD_PASSWORD>'
# create the helm values file
cat <<EOF > external-dns-adguard-values.yaml
provider: webhook
extraArgs:
webhook-provider-url: http://localhost:8888
sidecars:
- name: adguard-webhook
image: ghcr.io/muhlba91/external-dns-provider-adguard:$RELEASE_VERSION
ports:
- containerPort: 8888
name: http
livenessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 10
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 10
timeoutSeconds: 5
env:
- name: LOG_LEVEL
value: debug
- name: ADGUARD_HOME
valueFrom:
secretKeyRef:
name: adguard-configuration
key: url
- name: ADGUARD_USER
valueFrom:
secretKeyRef:
name: adguard-configuration
key: user
- name: ADGUARD_PASSWORD
valueFrom:
secretKeyRef:
name: adguard-configuration
key: password
- name: SERVER_HOST
value: "0.0.0.0"
- name: DRY_RUN
value: "false"
EOF
# install external-dns with helm
helm install external-dns-adguard bitnami/external-dns -f external-dns-adguard-values.yaml
Contributors
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!