tailscale / tailscale/tailscale

MagicDNS lookups have 5s delay on macOS

Open
#5,308 8 comments 1 reaction 0 assignees View on GitHub
bug dns L2 Few OS-macos P2 Aggravating T5 Usability
Dominant language
Go
Stars
36.5k
Forks
3.2k
Avg merge
1d 23h
Merged PRs (30d)
132

Description

### What is the issue?

MagicDNS lookups from my macOS client have a consistent 5 second delay when using only the machine name, but lookups are fast as expected when using the full name with *.{domain}.beta.tailscale.net.

### Steps to reproduce

Lookup with machine name only:
```
time dscacheutil -q host -a name {host name}
name: {host name}.{domain}.beta.tailscale.net
ip_address: 100.93.12.46

dscacheutil -q host -a name {host name} 0.00s user 0.00s system 0% cpu 5.014 total
```

If I lookup by the fqdn rather than machine name, resolution is quick:
```
time dscacheutil -q host -a name {host name}.{domain}.beta.tailscale.net
name: {host name}.{domain}.beta.tailscale.net
ip_address: 100.93.12.46

dscacheutil -q host -a name 0.00s user 0.00s system 36% cpu 0.016 total
```

This delay is noticeable via browser, curl, nc, etc. when using only the machine name. Interestingly, using ping resolves quickly - I'm not sure if there is some caching going behind the scenes there.

example with nc:
```
time nc -zv {host name} 3002
Connection to {host name} port 3002 [tcp/exlm-agent] succeeded!
nc -zv {host name} 3002 0.01s user 0.01s system 0% cpu 5.043 total
```

### Are there any recent changes that introduced the issue?

n/a

### OS

macOS

### OS version

12.4

### Tailscale version

1.28

### Bug report

BUG-b190cd840a3a272d8a2b36a4311dbd6aa24e76f2d13cd3cffe3127e0e7100cab-20220805193117Z-891f6b9c55e18126

Contributor guide

Open the contributing guide

Research direction

Reproduce on macOS 12.4 with the dscacheutil commands for a machine name and its full beta.tailscale.net name, then compare the nc and ping behavior. Trace the MagicDNS path involved in short-name resolution. Done means machine-name lookups no longer incur the reported five-second delay while FQDN lookups remain fast.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.