[Feature] Extra DNS Records / API support CNAME / wildcards #989

Closed
opened 2025-12-29 02:27:06 +01:00 by adam · 3 comments
Owner

Originally created by @tgrushka on GitHub (Mar 27, 2025).

Use case

Piggybacking on #1356 and #1496 which have been closed.

Thank you for the extra_records_path config variable/feature. This is a great start.

Unfortunately, headscale assigns dynamic IP addresses, meaning this file will have to be updated every time something changes.

Would be nice to have:

  1. CNAME for an entry, so I could CNAME b.vpn.example.com to a.vpn.example.com.

  2. WILDCARD with A/AAAA or CNAME ability, so I could have *.something.vpn.example.com all redirect to an IP or CNAME.

  3. I agree with previous issues, that API should support it, even though I'm not using the API.

Description

There were comments (e.g. https://github.com/juanfont/headscale/issues/1356#issuecomment-1616268450) concerned that headscale cannot obtain certs for these. This is not a problem, because reverse proxies such as Caddy can obtain these for you. No need to run your own CA as the comment suggested.

I think just enabling CNAME and WILDCARD names would not be a major undertaking, since A/AAAA records are already supported.

Thank you.

Contribution

  • I can write the design doc for this feature
  • I can contribute this feature

How can it be implemented?

I don't know, I'm a Rust programmer with only about 3 months of experience in Go, plus many other languages in my career, but not enough Go to be able to do this properly. Thanks, this is a great tool, but I build apps/backends, not network stacks. 😄

Originally created by @tgrushka on GitHub (Mar 27, 2025). ### Use case Piggybacking on #1356 and #1496 which have been closed. Thank you for the extra_records_path config variable/feature. This is a great start. Unfortunately, headscale assigns dynamic IP addresses, meaning this file will have to be updated every time something changes. Would be nice to have: 1. CNAME for an entry, so I could CNAME b.vpn.example.com to a.vpn.example.com. 2. WILDCARD with A/AAAA or CNAME ability, so I could have *.something.vpn.example.com all redirect to an IP or CNAME. 3. I agree with previous issues, that API should support it, even though I'm not using the API. ### Description There were comments (e.g. https://github.com/juanfont/headscale/issues/1356#issuecomment-1616268450) concerned that headscale cannot obtain certs for these. **This is not a problem**, because reverse proxies such as **Caddy** can obtain these for you. **No need to run your own CA** as the comment suggested. I think just enabling **CNAME** and **WILDCARD** names would not be a major undertaking, since **A/AAAA** records are already supported. Thank you. ### Contribution - [ ] I can write the design doc for this feature - [ ] I can contribute this feature ### How can it be implemented? I don't know, I'm a Rust programmer with only about 3 months of experience in Go, plus many other languages in my career, but not enough Go to be able to do this properly. Thanks, this is a great tool, but I build apps/backends, not network stacks. 😄
adam added the enhancementstale labels 2025-12-29 02:27:06 +01:00
adam closed this issue 2025-12-29 02:27:06 +01:00
Author
Owner

@kradalby commented on GitHub (Mar 30, 2025):

CNAME for an entry, so I could CNAME b.vpn.example.com to a.vpn.example.com.
WILDCARD with A/AAAA or CNAME ability, so I could have *.something.vpn.example.com all redirect to an IP or CNAME.

This is not intentionally left out, they are not supported because the client does not support them so we cannot add it.

I agree with previous issues, that API should support it, even though I'm not using the API.

This is intentionally left out as it comes down to where we have stored the data, we have extra dns in a file, and the API only covers the database. We do not really want to have to to a multi-way-merge by having N amount of places with the data and add unnecessary complexity, so likely no API support.

@kradalby commented on GitHub (Mar 30, 2025): > CNAME for an entry, so I could CNAME b.vpn.example.com to a.vpn.example.com. > WILDCARD with A/AAAA or CNAME ability, so I could have *.something.vpn.example.com all redirect to an IP or CNAME. This is not intentionally left out, they are not supported because the client does not support them so we cannot add it. > I agree with previous issues, that API should support it, even though I'm not using the API. This is intentionally left out as it comes down to where we have stored the data, we have extra dns in a file, and the API only covers the database. We do not really want to have to to a multi-way-merge by having N amount of places with the data and add unnecessary complexity, so likely no API support.
Author
Owner

@github-actions[bot] commented on GitHub (Jun 29, 2025):

This issue is stale because it has been open for 90 days with no activity.

@github-actions[bot] commented on GitHub (Jun 29, 2025): This issue is stale because it has been open for 90 days with no activity.
Author
Owner

@github-actions[bot] commented on GitHub (Jul 7, 2025):

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions[bot] commented on GitHub (Jul 7, 2025): This issue was closed because it has been inactive for 14 days since being marked as stale.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#989