After Installing a VPN, the Server Can't Find Office PCs by Name

November 2026

The symptom

You installed a VPN client (Tailscale, or one that connects to a self-hosted Headscale server) on the office server so staff can connect from outside. After that:

  • ping 192.168.1.50 works, but ping PC1 or \\PC1 does not.
  • Nothing was changed on the LAN, and the problem can stay after a restart.

Why it happens

Many VPNs set the machine's DNS. The common setting pushes a public resolver such as 1.1.1.1, or the VPN's own resolver (Tailscale calls this MagicDNS). A public DNS server has never heard of PC1, because that name only exists on your office network. Windows asks it first, gets "unknown", and stops.

Step 1: See which DNS the server uses

Get-DnsClientServerAddress -AddressFamily IPv4 | Select InterfaceAlias, ServerAddresses

On a healthy office server, the LAN adapter points to your router (for example 192.168.1.1) or to your own DNS server. If it shows 1.1.1.1, 8.8.8.8 or 100.100.100.100, the VPN has taken over.

Then test a name:

Resolve-DnsName PC1
ping PC1

Step 2: Turn off the VPN's DNS takeover

You can do this in one of two places.

On the VPN server (best, fixes every machine at once). If you run Headscale, edit its config.yaml and set:

dns:
  magic_dns: false
  override_local_dns: false

Restart Headscale. Machines pick up the new setting the next time they refresh their network settings; if one still shows the old DNS, restart the VPN client on it (or run the command below). With a hosted Tailscale, the same options are in the admin console under DNS (turn off Override local DNS and MagicDNS).

On one machine only. On the server, run:

tailscale set --accept-dns=false

Step 3: Check again

Run the commands in Step 1 again. The LAN adapter should be back on your router, and ping PC1 should work. If it still doesn't:

ipconfig /flushdns

If the name still fails, add a line to C:\Windows\System32\drivers\etc\hosts as a quick workaround: 192.168.1.50 PC1. This is a patch. It breaks if the PC's IP changes, so use a fixed IP or a DHCP reservation for that PC.

A related reminder

If the VPN is installed only so you can reach the server remotely, you don't need MagicDNS at all. You connect by the server's VPN address. Leaving DNS alone is the safest default, because it can't break the office LAN. See how to give staff Remote Desktop access without opening a port.

Related guides


← All troubleshooting guides