[PR #129] [MERGED] Add support for MagicDNS #1274

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

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/129
Author: @juanfont
Created: 9/28/2021
Status: Merged
Merged: 10/10/2021
Merged by: @juanfont

Base: mainHead: magic-dns-support


📝 Commits (10+)

  • 3f3cfed Add support for MagicDNS
  • c9e4da3 Improving documentation for DNS config
  • 5dbf6b5 Extended DNS config unit tests
  • 656237e Propagate dns config vales across Headscale
  • e432e98 Send hostname in toNode
  • 45e71ec Generated MagicDNS search domains (only in 100.64.0.0/10)
  • 36ae14b Send search domains
  • 1949265 Fixed error on assign
  • 8d60ae2 Tidy gomod
  • 47dcc94 Fixed issue in tests

📊 Changes

14 files changed (+307 additions, -42 deletions)

View changed files

📝 README.md (+8 -8)
📝 api.go (+23 -13)
📝 app.go (+14 -1)
📝 cmd/headscale/cli/utils.go (+25 -5)
📝 cmd/headscale/headscale_test.go (+3 -3)
📝 config.json.postgres.example (+4 -1)
📝 config.json.sqlite.example (+4 -1)
dns.go (+73 -0)
dns_test.go (+63 -0)
docs/DNS.md (+33 -0)
📝 go.mod (+2 -2)
📝 integration_test.go (+33 -1)
📝 integration_test/etc/config.json (+10 -2)
📝 machine.go (+12 -5)

📄 Description

This PR adds support for MagicDNS.

The relevant part of the config.json looks like this:

  ...
    "dns_config": {
        "nameservers": [
            "1.1.1.1"
        ],
        "magic_dns": true
    }

I plan to add docs + integration tests, but I am having issues testing this in my computers. I get Temporary failure in name resolution unless I hardcode 100.100.100.100 in /etc/resolv.conf. In that case it actually works.

Looks like Tailscale does not like my systemd-resolve/NetworkManager setup.

@kradalby can you have a look?


🔄 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/129 **Author:** [@juanfont](https://github.com/juanfont) **Created:** 9/28/2021 **Status:** ✅ Merged **Merged:** 10/10/2021 **Merged by:** [@juanfont](https://github.com/juanfont) **Base:** `main` ← **Head:** `magic-dns-support` --- ### 📝 Commits (10+) - [`3f3cfed`](https://github.com/juanfont/headscale/commit/3f3cfedffac94ea2df5ed03204ac6ab6741a8d09) Add support for MagicDNS - [`c9e4da3`](https://github.com/juanfont/headscale/commit/c9e4da3ff5d4879a27ba8d4ca1618010d7573d7a) Improving documentation for DNS config - [`5dbf6b5`](https://github.com/juanfont/headscale/commit/5dbf6b512741c4955dd9b7016616ea0849357f52) Extended DNS config unit tests - [`656237e`](https://github.com/juanfont/headscale/commit/656237e167fcee22c3f88107c3ac93f91d25043f) Propagate dns config vales across Headscale - [`e432e98`](https://github.com/juanfont/headscale/commit/e432e98413226e3d2779452bcd817bcbaccdf480) Send hostname in toNode - [`45e71ec`](https://github.com/juanfont/headscale/commit/45e71ecba09e22611b5b092c8b1c4a632eb901c4) Generated MagicDNS search domains (only in 100.64.0.0/10) - [`36ae14b`](https://github.com/juanfont/headscale/commit/36ae14bccf9af1a940d262cb6945b67606876654) Send search domains - [`1949265`](https://github.com/juanfont/headscale/commit/19492650d4781ae6c3b4ace9d166274069229dc1) Fixed error on assign - [`8d60ae2`](https://github.com/juanfont/headscale/commit/8d60ae2c7e9b77b95d1226f9dd3615b5ad4d1964) Tidy gomod - [`47dcc94`](https://github.com/juanfont/headscale/commit/47dcc940c0f3baac6e6eba452a6e202c42bcd3e6) Fixed issue in tests ### 📊 Changes **14 files changed** (+307 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+8 -8) 📝 `api.go` (+23 -13) 📝 `app.go` (+14 -1) 📝 `cmd/headscale/cli/utils.go` (+25 -5) 📝 `cmd/headscale/headscale_test.go` (+3 -3) 📝 `config.json.postgres.example` (+4 -1) 📝 `config.json.sqlite.example` (+4 -1) ➕ `dns.go` (+73 -0) ➕ `dns_test.go` (+63 -0) ➕ `docs/DNS.md` (+33 -0) 📝 `go.mod` (+2 -2) 📝 `integration_test.go` (+33 -1) 📝 `integration_test/etc/config.json` (+10 -2) 📝 `machine.go` (+12 -5) </details> ### 📄 Description This PR adds support for MagicDNS. The relevant part of the config.json looks like this: ```json ... "dns_config": { "nameservers": [ "1.1.1.1" ], "magic_dns": true } ``` I plan to add docs + integration tests, but I am having issues testing this in my computers. I get `Temporary failure in name resolution` unless I hardcode `100.100.100.100` in `/etc/resolv.conf`. In that case it actually works. Looks like Tailscale does not like my systemd-resolve/NetworkManager setup. @kradalby can you have a look? --- <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:31 +01:00
adam closed this issue 2025-12-29 02:29:31 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1274