Bug: Support multi-level subdomains with wildcard (*.a.b.c.domain.tld) #123

Closed
opened 2025-11-20 04:20:38 -05:00 by saavagebueno · 6 comments
Owner

Originally created by @100terres on GitHub (Jun 12, 2021).

Originally assigned to: @qdm12 on GitHub.

TLDR: Wilcard subdomain seems to be supported since 24c8a9e971, but it only works for * and not *.multiple.subdomains (It's seems to be related to this resolved issue)

  1. Is this urgent: No
  2. DNS provider(s) you use: Cloudflare
  3. Program version: e19cabc
  4. What are you using to run the container: docker-compose
  5. Extra information (optional)

Logs:

2021/06/12 12:25:44 INFO Found 2 settings to update records
2021/06/12 12:25:44 INFO Reading history from database: domain 100terres.com host home
2021/06/12 12:25:44 INFO Reading history from database: domain 100terres.com host *.home
2021/06/12 12:25:44 INFO healthcheck server: listening on 127.0.0.1:9999
2021/06/12 12:25:44 INFO backup: disabled
2021/06/12 12:25:44 INFO http server: listening on 0.0.0.0:8000
2021/06/12 12:25:45 WARN cannot DNS resolve *.home.100terres.com after 5 tries: lookup *.home.100terres.com: no such host
2021/06/12 12:25:45 INFO IPv4 address of *.home.100terres.com is <nil> and your IPv4 address is 107.159.47.133
2021/06/12 12:25:45 INFO Updating record [domain: 100terres.com | host: *.home | provider: cloudflare | ip: ipv4] to use 107.159.47.133
2021/06/12 12:30:45 WARN cannot DNS resolve *.home.100terres.com after 5 tries: lookup *.home.100terres.com: no such host
2021/06/12 12:30:45 INFO IPv4 address of *.home.100terres.com is <nil> and your IPv4 address is 107.159.47.133
2021/06/12 12:30:45 INFO Updating record [domain: 100terres.com | host: *.home | provider: cloudflare | ip: ipv4] to use 107.159.47.133

Configuration file:

{
  "settings": [
    {
      "provider": "cloudflare",
      "zone_identifier": "secret",
      "domain": "100terres.com",
      "host": "home",
      "ttl": 1,
      "token": "secret",
      "ip_version": "ipv4"
    },
    {
      "provider": "cloudflare",
      "zone_identifier": "secret",
      "domain": "100terres.com",
      "host": "*.home",
      "ttl": 1,
      "token": "secret",
      "ip_version": "ipv4"
    }
  ]
}

Host OS: Windows 10

Originally created by @100terres on GitHub (Jun 12, 2021). Originally assigned to: @qdm12 on GitHub. **TLDR**: Wilcard subdomain seems to be supported since https://github.com/qdm12/ddns-updater/commit/24c8a9e971fc47d2d3235bc44c6eba79cd1465d2, but it only works for `*` and not `*.multiple.subdomains` (It's seems to be related to [this resolved issue](https://github.com/qdm12/ddns-updater/issues/25)) 1. Is this urgent: No 2. DNS provider(s) you use: Cloudflare 3. Program version: e19cabc 4. What are you using to run the container: docker-compose 5. Extra information (optional) Logs: ```log 2021/06/12 12:25:44 INFO Found 2 settings to update records 2021/06/12 12:25:44 INFO Reading history from database: domain 100terres.com host home 2021/06/12 12:25:44 INFO Reading history from database: domain 100terres.com host *.home 2021/06/12 12:25:44 INFO healthcheck server: listening on 127.0.0.1:9999 2021/06/12 12:25:44 INFO backup: disabled 2021/06/12 12:25:44 INFO http server: listening on 0.0.0.0:8000 2021/06/12 12:25:45 WARN cannot DNS resolve *.home.100terres.com after 5 tries: lookup *.home.100terres.com: no such host 2021/06/12 12:25:45 INFO IPv4 address of *.home.100terres.com is <nil> and your IPv4 address is 107.159.47.133 2021/06/12 12:25:45 INFO Updating record [domain: 100terres.com | host: *.home | provider: cloudflare | ip: ipv4] to use 107.159.47.133 2021/06/12 12:30:45 WARN cannot DNS resolve *.home.100terres.com after 5 tries: lookup *.home.100terres.com: no such host 2021/06/12 12:30:45 INFO IPv4 address of *.home.100terres.com is <nil> and your IPv4 address is 107.159.47.133 2021/06/12 12:30:45 INFO Updating record [domain: 100terres.com | host: *.home | provider: cloudflare | ip: ipv4] to use 107.159.47.133 ``` Configuration file: ```json { "settings": [ { "provider": "cloudflare", "zone_identifier": "secret", "domain": "100terres.com", "host": "home", "ttl": 1, "token": "secret", "ip_version": "ipv4" }, { "provider": "cloudflare", "zone_identifier": "secret", "domain": "100terres.com", "host": "*.home", "ttl": 1, "token": "secret", "ip_version": "ipv4" } ] } ``` Host OS: Windows 10
Author
Owner

@100terres commented on GitHub (Jun 12, 2021):

By the way, thank you @qdm12 for this project!

@100terres commented on GitHub (Jun 12, 2021): By the way, thank you @qdm12 for this project!
Author
Owner

@100terres commented on GitHub (Jun 12, 2021):

We could probably fix this small issue by changing a couple of lines in this file
1705afeada/internal/settings/utils/domain.go (L7-L8)

@100terres commented on GitHub (Jun 12, 2021): We could probably fix this small issue by changing a couple of lines in this file https://github.com/qdm12/ddns-updater/blob/1705afeadaf4b37b43e06a85505cc41ea95b09a3/internal/settings/utils/domain.go#L7-L8
Author
Owner

@qdm12 commented on GitHub (Jun 12, 2021):

I'll look into it tomorrow. The file you pointed is just for the display in the UI. It should be more inside internal/settings/providers/Cloudflare I think.

Thanks for pointing the issue out!

@qdm12 commented on GitHub (Jun 12, 2021): I'll look into it tomorrow. The file you pointed is just for the display in the UI. It should be more inside internal/settings/providers/Cloudflare I think. Thanks for pointing the issue out!
Author
Owner

@100terres commented on GitHub (Jun 12, 2021):

Perfect! Thank you 🙂

@100terres commented on GitHub (Jun 12, 2021): Perfect! Thank you :slightly_smiling_face:
Author
Owner

@qdm12 commented on GitHub (Jun 13, 2021):

This should be fixed in the latest image with commit bb62a9d9e1

Actually that was a wildcard bug for many (if not all) DNS providers, so kudos on finding that bug 👍
Also display should now show any.host.host.domain.com for *.host.host.domain.com instead of just any.domain.com which was wrong too.

Let me know if it works for you, thanks!

@qdm12 commented on GitHub (Jun 13, 2021): This should be fixed in the latest image with commit bb62a9d9e18178f4bd220c03202bc965b9e462e8 Actually that was a wildcard bug for many (if not all) DNS providers, so kudos on finding that bug 👍 Also display should now show `any.host.host.domain.com` for `*.host.host.domain.com` instead of just `any.domain.com` which was wrong too. Let me know if it works for you, thanks!
Author
Owner

@100terres commented on GitHub (Jun 14, 2021):

Hi @qdm12, I tried it with the latest tag from docker hub and it seems to be working ! Here are the logs :

Running version latest built on 2021-06-14T15:38:18Z (commit ee66170)

[...]

2021/06/15 01:13:39 INFO Found 2 settings to update records
2021/06/15 01:13:40 INFO Reading history from database: domain 100terres.com host home
2021/06/15 01:13:40 INFO Reading history from database: domain 100terres.com host *.home
2021/06/15 01:13:40 INFO healthcheck server: listening on 127.0.0.1:9999
2021/06/15 01:13:40 INFO http server: listening on 0.0.0.0:8000
2021/06/15 01:13:40 INFO backup: disabled
2021/06/15 01:13:40 INFO IPv4 address of home.100terres.com is 181.215.0.51 and your IPv4 address is 107.159.47.133
2021/06/15 01:13:40 INFO IPv4 address of any.home.100terres.com is 181.215.0.51 and your IPv4 address is 107.159.47.133
2021/06/15 01:13:40 INFO Updating record [domain: 100terres.com | host: home | provider: cloudflare | ip: ipv4] to use 107.159.47.133
2021/06/15 01:13:40 INFO Updating record [domain: 100terres.com | host: *.home | provider: cloudflare | ip: ipv4] to use 107.159.47.133

Thank you for your fix! 🙏

I'll let you close this ticket 🙂

@100terres commented on GitHub (Jun 14, 2021): Hi @qdm12, I tried it with the `latest` tag from docker hub and it seems to be working ! Here are the logs : ``` Running version latest built on 2021-06-14T15:38:18Z (commit ee66170) [...] 2021/06/15 01:13:39 INFO Found 2 settings to update records 2021/06/15 01:13:40 INFO Reading history from database: domain 100terres.com host home 2021/06/15 01:13:40 INFO Reading history from database: domain 100terres.com host *.home 2021/06/15 01:13:40 INFO healthcheck server: listening on 127.0.0.1:9999 2021/06/15 01:13:40 INFO http server: listening on 0.0.0.0:8000 2021/06/15 01:13:40 INFO backup: disabled 2021/06/15 01:13:40 INFO IPv4 address of home.100terres.com is 181.215.0.51 and your IPv4 address is 107.159.47.133 2021/06/15 01:13:40 INFO IPv4 address of any.home.100terres.com is 181.215.0.51 and your IPv4 address is 107.159.47.133 2021/06/15 01:13:40 INFO Updating record [domain: 100terres.com | host: home | provider: cloudflare | ip: ipv4] to use 107.159.47.133 2021/06/15 01:13:40 INFO Updating record [domain: 100terres.com | host: *.home | provider: cloudflare | ip: ipv4] to use 107.159.47.133 ``` Thank you for your fix! :pray: I'll let you close this ticket :slightly_smiling_face:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ddns-updater#123