DNS无法被Tailscale自动修改/ DNS Unchanged After Installation

  • 情况一

一般比较容易出现在Ubuntu及较高版本的Debian系统

原因是系统自带systemd-resolved的DNS服务器占用了53端口。需要手动卸载该服务并指定Tailscale的DNS。

以下为具体步骤:

  1. 检查系统是否带有systemd-resolved服务,apt install lsof && lsof -i:53

  2. 如果53端口被systemd-resolved占用,则运行下面的命令:

  3. systemctl disable systemd-resolved --now

  4. rm /etc/resolv.conf

  5. echo "nameserver 100.100.100.100" > /etc/resolv.conf

  • 情况二

如果系统中的53端口并没有被其他程序占用,您可以简单地重启tailscale并查看系统DNS是否有被修改成100.100.100.100

  • tailscale down && tailscale up

  • cat /etc/resolv.conf

如果此时系统DNS仍非100.100.100.100,您可以手动修改系统DNS

  • echo "nameserver 100.100.100.100" > /etc/resolv.conf

DNS Cannot Be Automatically Modified by Tailscale

Scenario 1

This issue often occurs on Ubuntu or newer versions of Debian systems.

Cause: The system’s built-in systemd-resolved DNS service occupies port 53. You need to manually disable this service and specify Tailscale’s DNS.

Steps:

  1. Check whether the system has the systemd-resolved service:

    apt install lsof && lsof -i:53
  2. If port 53 is occupied by systemd-resolved, run the following commands:

    systemctl disable systemd-resolved --now
  3. Remove the existing DNS configuration file:

    rm /etc/resolv.conf
  4. Add Tailscale’s DNS configuration:

    echo "nameserver 100.100.100.100" > /etc/resolv.conf

Scenario 2

If port 53 is not occupied by any process, you can simply restart Tailscale to check whether the system DNS has been changed to 100.100.100.100:

tailscale down && tailscale up  
cat /etc/resolv.conf

If your system DNS is still not 100.100.100.100, you can manually modify it:

echo "nameserver 100.100.100.100" > /etc/resolv.conf

Last updated