Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
100terres opened this issue Jun 12, 2021 · 6 comments
Closed
Assignees

Comments

@100terres
Copy link

100terres commented Jun 12, 2021

TLDR: Wilcard subdomain seems to be supported since 24c8a9e, 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

@100terres
Copy link
Author

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

@100terres
Copy link
Author

We could probably fix this small issue by changing a couple of lines in this file

case "*":
return "any." + domain

@100terres 100terres changed the title Bug: Wildcard support for subdomains *.a.b.c.domain.tld Bug: Support multi-level subdomains with wildcard (*.a.b.c.domain.tld) Jun 12, 2021
@qdm12
Copy link
Owner

qdm12 commented 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!

@100terres
Copy link
Author

Perfect! Thank you 🙂

qdm12 added a commit that referenced this issue Jun 14, 2021
- Keep multi-dots wildcard host structure in display strings
- Use another function BuildURLQueryHostname for API calls
- Send the wildcard character in API calls
- Fix issue #214
- Fix behavior for wildcard hosts for:
  - cloudflare
  - ddnss.de
  - digitalocean
  - dnsomatic
  - dreamhost
  - dyn
  - dynv6
  - google
  - informaniak
  - njalla
  - noip
  - opendns
  - ovh
  - selfhost.de
  - spdyn
  - strato
  - variomedia
@qdm12
Copy link
Owner

qdm12 commented Jun 14, 2021

This should be fixed in the latest image with commit bb62a9d

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!

@100terres
Copy link
Author

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 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants