MagicDNS doesn't register hostnames with upper-case letters #141

Closed
opened 2025-12-29 01:23:52 +01:00 by adam · 8 comments
Owner

Originally created by @skoobasteeve on GitHub (Feb 28, 2022).

Bug description

Machines are not added to MagicDNS if their hostname contains capital letters.

To Reproduce

  1. Set hostname on client system to something with capital letters e.g. Foo-Bar.
  2. Enroll with Headscale server using tailscale up --login-server <URL> --auth-key <AUTH_KEY>
  3. Try to ping the client system from another client using Foo-Bar or Foo-Bar..
    OR run nslookup Foo-Bar
  4. Receive failures on both commands
  5. Re-connect to the Headscale server and manually set hostname to lower-case letters using tailscale up --hostname=foo-bar --login-server <URL>
  6. Ping and nslookup are both able to find the system at foo-bar.

Context info

  • Headscale version: 14.0
  • Tailscale client: 1.22
  • Server OS: Ubuntu 20.04
  • Client OS: Ubuntu 20.04

Let me know if this is a known issue or if anyone else can reproduce it. I have limited systems to test on.

Thank you!

Originally created by @skoobasteeve on GitHub (Feb 28, 2022). **Bug description** Machines are not added to MagicDNS if their hostname contains capital letters. **To Reproduce** 1. Set hostname on client system to something with capital letters e.g. Foo-Bar. 2. Enroll with Headscale server using `tailscale up --login-server <URL> --auth-key <AUTH_KEY>` 3. Try to ping the client system from another client using Foo-Bar or Foo-Bar.<namespace>.<baseurl> OR run `nslookup Foo-Bar` 4. Receive failures on both commands 5. Re-connect to the Headscale server and manually set hostname to lower-case letters using `tailscale up --hostname=foo-bar --login-server <URL>` 6. Ping and nslookup are both able to find the system at foo-bar. **Context info** - Headscale version: 14.0 - Tailscale client: 1.22 - Server OS: Ubuntu 20.04 - Client OS: Ubuntu 20.04 Let me know if this is a known issue or if anyone else can reproduce it. I have limited systems to test on. Thank you!
adam added the bug label 2025-12-29 01:23:52 +01:00
adam closed this issue 2025-12-29 01:23:52 +01:00
Author
Owner

@kyhwana commented on GitHub (Feb 28, 2022):

Hmm, appears to work with tailscale ping, but not nslookup or ping in linux..

@kyhwana commented on GitHub (Feb 28, 2022): Hmm, appears to work with tailscale ping, but not nslookup or ping in linux..
Author
Owner

@kyhwana commented on GitHub (Feb 28, 2022):

There's something funky somewhere.. Adding hostname = strings.ToLower(hostname) at line 616 in machine.go fixes this.
(As in)

} else {
		hostname = machine.Name
	}
	hostname = strings.ToLower(hostname)

	node := tailcfg.Node{

@kyhwana commented on GitHub (Feb 28, 2022): There's something funky somewhere.. Adding ``` hostname = strings.ToLower(hostname) ``` at line 616 in machine.go fixes this. (As in) ``` } else { hostname = machine.Name } hostname = strings.ToLower(hostname) node := tailcfg.Node{ ```
Author
Owner

@restanrm commented on GitHub (Feb 28, 2022):

In your opinion, should we normalize the machine.Name with b1bd17f316/namespaces.go (L242-L264) or accept Uppercase letters ?

@restanrm commented on GitHub (Feb 28, 2022): In your opinion, should we normalize the `machine.Name` with https://github.com/juanfont/headscale/blob/b1bd17f3164c3921b5f410bcb4faa3ef4da8fba2/namespaces.go#L242-L264 or accept Uppercase letters ?
Author
Owner

@kyhwana commented on GitHub (Feb 28, 2022):

@restanrm I think it depends where the actual issue with upper case letters affecting magicDNS is? It just needs to be done before wherever they get added to magicdns dns entries. (From what I can tell)

@kyhwana commented on GitHub (Feb 28, 2022): @restanrm I think it depends where the actual issue with upper case letters affecting magicDNS is? It just needs to be done before wherever they get added to magicdns dns entries. (From what I can tell)
Author
Owner

@e-zk commented on GitHub (Mar 2, 2022):

Let me know if this is a known issue or if anyone else can reproduce it.

Not sure if it's directly related to this issue, but my Android phone with hostname "Pixel 4a" (shown via tailscale status), doesn't resolve with nslookup pixel-4a nor, nslookup Pixel-4a.

@e-zk commented on GitHub (Mar 2, 2022): > Let me know if this is a known issue or if anyone else can reproduce it. Not sure if it's directly related to this issue, but my Android phone with hostname "Pixel 4a" (shown via `tailscale status`), doesn't resolve with `nslookup pixel-4a` nor, `nslookup Pixel-4a`.
Author
Owner

@ohdearaugustin commented on GitHub (Mar 3, 2022):

I guess the magicdns should be conform to the RFC https://tools.ietf.org/html/rfc4343. Therefore we should accept uppercase letters in the dns name.

@ohdearaugustin commented on GitHub (Mar 3, 2022): I guess the magicdns should be conform to the RFC https://tools.ietf.org/html/rfc4343. Therefore we should accept uppercase letters in the dns name.
Author
Owner

@kradalby commented on GitHub (Mar 3, 2022):

If the issue is that uppercase is not accepted, then I think we should just lowercase it at that point, and let users have uppercase if they join with that.

I think it would be too much a nightmare to deny uppercase.

I would agree that all names should be unique in lowercase and therefor a normalise to lowercase before storing could make sense regardless. We need them to be unique

@kradalby commented on GitHub (Mar 3, 2022): If the issue is that uppercase is not accepted, then I think we should just lowercase it at that point, and let users have uppercase if they join with that. I think it would be too much a nightmare to deny uppercase. I would agree that all names should be unique in lowercase and therefor a normalise to lowercase before storing could make sense regardless. We need them to be unique
Author
Owner

@restanrm commented on GitHub (Mar 4, 2022):

@ohdearaugustin this RFC seems to have a lot of uncertainty about the behavior that we should expect (§4.2). Also if we apply this we should escape all special chars instead of replacing them (if I understand that RFC properly).

@restanrm commented on GitHub (Mar 4, 2022): @ohdearaugustin this RFC seems to have a lot of uncertainty about the behavior that we should expect (§4.2). Also if we apply this we should escape all special chars instead of replacing them (if I understand that RFC properly).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#141