TimothyYe / godns

A dynamic DNS client tool that supports AliDNS, Cloudflare, Google Domains, DNSPod, HE.net & DuckDNS & DreamHost, etc, written in Go.
https://timothyye.github.io/godns/
Apache License 2.0
1.5k stars 220 forks source link

Work around wildcard subdomain filtering bug in linode API #154

Closed drewgingerich closed 2 years ago

drewgingerich commented 2 years ago

This is a temporary fix for #146.

The Linode API should be able to be queried for data about a wildcard subdomain by using the Domain Records List endpoint with the header x-filter: {"name": "*"} to filter the list of subdomains for the wildcard subdomain as part of the API call.

The API has a bug, though, specifically for the wildcard subdomain. The above query returns an empty list even when the wildcard subdomain exists. For GoDNS, this means a new wildcard subdomain is created every time the IP changes or the program is restarted because it can't find the existing wildcard subdomain.

This PR makes a small change: instead of asking for the API to filter the response, GoDNS instead asks for all subdomains and filters them itself.

I have an open ticket with Linode support about this. When Linode fixes the bug in the API we can revert this.

TimothyYe commented 2 years ago

Thanks for your contribution.