AWS EC2 - Ubuntu 22.04 - DNS Issues with Tailscale

0

Description: I am currently experiencing a DNS configuration issue with an Ubuntu 22.04 instance hosted on AWS. The problem arises when I connect this instance to my Tailscale network. While connected to Tailscale, the instance loses its DNS configurations and is unable to connect to external resources via domain names.

Key Details: Ubuntu 22.04 instance on AWS. Successful connection to Tailscale network. DNS configurations are lost during Tailscale connection. Unable to access external resources via domain names while Tailscale is active. "MagicDNS" is not enabled. Changing DNS servers has no effect.

Issue Overview: The Ubuntu 22.04 instance connects successfully to my Tailscale network. Upon Tailscale activation, the instance loses its DNS configurations. As a result, the instance is unable to access external resources using domain names. DNS functionality is only restored after disconnecting from Tailscale. Attempts to change DNS servers do not resolve the issue. Request for Assistance: I kindly request assistance in diagnosing and resolving this DNS configuration issue. My goal is to maintain the original DNS settings on the Ubuntu instance while connected to Tailscale so that it can access external resources seamlessly.

Attempted Corrections: Running Tailscale with the following Commands:

  • sudo tailscale up --accept-dns=false --accept-routes The only time it seems to work is when I do the following, however it is short-lived:
  • mkdir -p /etc/systemd/resolved.conf.d
  • ln -sf /dev/null /etc/systemd/resolved.conf.d/resolved-disable-stub-listener.conf
  • ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

Additional Information: Tailscale is configured for network connectivity. EC2 service is the only machine with issues on the Tailscale network. Ubuntu 22.04 instance is running standard networking configurations. No apparent conflicts with "MagicDNS." Please advise on any steps, configurations, or troubleshooting procedures that can help resolve this issue. Your guidance is greatly appreciated.

Thank you for your assistance.

asked 4 months ago318 views
1 Answer
0

This is not an AWS issue but how the Tailscale application works. Depending on your requirement for DNS, you may wish to enable SPLIT DNS in TailScale and set the DNS Server for the EC2 to be the local Route 53 resolved situated on the VPC CIDR+2 IP Address, i.e 172.31.0.2

To implement split DNS using Tailscale:

  • Log in to your Tailscale account, then navigate to the DNS page on the admin console. This is where you can configure the split DNS setting for your network.
  • On the DNS page, assign a name to your server using the Add Nameserver drop-down menu. From this drop-down, select the Custom option, then input the IPv4 or IPv6 address of the internal DNS server that is to be used to resolve internal queries.
  • Finally, toggle the Restrict search domain button, fill the subsequent field with the desired web address name, and save the changes.

Its a known problem in TailScale https://tailscale.com/kb/1235/resolv-conf?q=dns

Another option You can manage DNS for your Tailscale network in at least three ways:

  • Using MagicDNS, our automatic DNS feature
  • Using the DNS settings page in the admin console
  • Using public DNS records

Add a new GLOBAL Name Server in TailScale to be the route53 resolver IP similar to above https://tailscale.com/kb/1054/dns so that when your EC2 connects to the VPN it will use the same as per default

profile picture
EXPERT
answered 4 months ago
  • Thank you, but my problem isn't internal queries but external domains. I did try the actions you mentioned, I still have the same problem.

  • Have you added the global name server? The AWS resolver resolves external domains

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions