[PR #98] [MERGED] Initial DNS server support #1257

Closed
opened 2025-12-29 02:29:28 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/98
Author: @kradalby
Created: 8/25/2021
Status: Merged
Merged: 8/25/2021
Merged by: @kradalby

Base: mainHead: initial-dns-server-exit-node


📝 Commits (7)

  • 987bbee Add DNSConfig field to configuration
  • e77c16b Add DNSConfig to example and setup test
  • 01e781e Pass DNSConfig to nodes in MapResponse
  • b3732e7 Add nameserver as resolver aswell
  • 3f5e06a Dont add the portnumber to the ip
  • 8735e56 Add a test for the getdnsconfig function
  • ba3dffe Update readme

📊 Changes

7 files changed (+100 additions, -9 deletions)

View changed files

📝 README.md (+2 -1)
📝 api.go (+9 -5)
📝 app.go (+2 -0)
📝 cmd/headscale/cli/utils.go (+43 -0)
📝 cmd/headscale/headscale_test.go (+32 -1)
📝 config.json.postgres.example (+6 -1)
📝 config.json.sqlite.example (+6 -1)

📄 Description

This PR adds a new config parameter to allow configuring the DNS servers that are passed to nodes, particularly when a client selects it as an exit node.

New configuration:

dns_config:
  nameservers:
    - 1.1.1.1
  domains:  # for search domains
    - example.com

Prior to this PR, using a node as exit would configure it with no DNS server and it would not work unless overridden by the OS.

I think this can be considered the first iteration of this configuration and interface, or the global version. We probably want to try to make something like the MagicDNS stuff that tailscale does upstream.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/juanfont/headscale/pull/98 **Author:** [@kradalby](https://github.com/kradalby) **Created:** 8/25/2021 **Status:** ✅ Merged **Merged:** 8/25/2021 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `initial-dns-server-exit-node` --- ### 📝 Commits (7) - [`987bbee`](https://github.com/juanfont/headscale/commit/987bbee1dbe9de611bc409e0f39647e460fda25e) Add DNSConfig field to configuration - [`e77c16b`](https://github.com/juanfont/headscale/commit/e77c16b55a949d4d181a839771269e6335d03916) Add DNSConfig to example and setup test - [`01e781e`](https://github.com/juanfont/headscale/commit/01e781e546299627ecf47f5750bb211b15b99b0d) Pass DNSConfig to nodes in MapResponse - [`b3732e7`](https://github.com/juanfont/headscale/commit/b3732e7fb9d9dd28da35ac9c9b62a99e483da860) Add nameserver as resolver aswell - [`3f5e06a`](https://github.com/juanfont/headscale/commit/3f5e06a0f8c4344dcd41a7d433aa7ff1627c2d91) Dont add the portnumber to the ip - [`8735e56`](https://github.com/juanfont/headscale/commit/8735e5675cf61ea3ea4e797f5155943966b056eb) Add a test for the getdnsconfig function - [`ba3dffe`](https://github.com/juanfont/headscale/commit/ba3dffecbfeb616660f66500ae08299d6d43be14) Update readme ### 📊 Changes **7 files changed** (+100 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+2 -1) 📝 `api.go` (+9 -5) 📝 `app.go` (+2 -0) 📝 `cmd/headscale/cli/utils.go` (+43 -0) 📝 `cmd/headscale/headscale_test.go` (+32 -1) 📝 `config.json.postgres.example` (+6 -1) 📝 `config.json.sqlite.example` (+6 -1) </details> ### 📄 Description This PR adds a new config parameter to allow configuring the DNS servers that are passed to nodes, particularly when a client selects it as an exit node. New configuration: ```yaml dns_config: nameservers: - 1.1.1.1 domains: # for search domains - example.com ``` Prior to this PR, using a node as exit would configure it with no DNS server and it would not work unless overridden by the OS. I think this can be considered the first iteration of this configuration and interface, or the `global` version. We probably want to try to make something like the MagicDNS stuff that tailscale does upstream. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 02:29:28 +01:00
adam closed this issue 2025-12-29 02:29:28 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1257