- Newest
- Most votes
- Most comments
This issue appears to be related to how DNS resolution is working on your Mac when connected to the AWS Client VPN. Even though you've configured the VPN to use the private DNS server (10.0.0.2), your Mac may not be using this DNS server for all lookups.
Here are some troubleshooting steps to resolve this issue:
- Verify DNS server configuration in your Client VPN endpoint: Check that the DNS server (10.0.0.2) is properly configured in your Client VPN endpoint. You can verify this using the AWS CLI:
aws ec2 describe-client-vpn-endpoints --client-vpn-endpoint-ids your-endpoint-id --query 'ClientVpnEndpoints[0].DnsServers'
- Check DNS resolution from your client: Test DNS resolution directly using tools like nslookup or dig to see if they're using the VPN's DNS server:
nslookup your-eks-endpoint.region.eks.amazonaws.com
dig your-eks-endpoint.region.eks.amazonaws.com
-
Security group configuration: Ensure that security groups allow DNS traffic (UDP/TCP port 53) from the Client VPN CIDR to the DNS servers.
-
DNS resolution order on macOS: macOS has its own DNS resolution order that might be bypassing the VPN's DNS settings. You can try:
- Checking your DNS settings after connecting to VPN using
scutil --dns - Modifying your DNS search order in Network preferences
- Creating a specific DNS configuration for the VPN interface
- Alternative solution: Since you mentioned that adding entries to /etc/hosts works, you could create a more permanent solution by:
- Adding the EKS endpoint and its private IP to your /etc/hosts file
- Using a local DNS resolver like dnsmasq to override specific domain resolutions
- Creating a script that updates your hosts file when connecting to the VPN
The issue is likely related to how macOS handles DNS resolution when connected to VPN. The VPN client might not be pushing the DNS configuration with high enough priority to override the system's default DNS resolution path for all applications.
Sources
Troubleshooting AWS Client VPN: Tunnel connectivity issues to a VPC - AWS Client VPN
DNS issues with Client VPN connection | AWS re:Post
Kubernetes concepts for hybrid nodes - Amazon EKS
this appears to be an issue due to network filters with DNS settings to use https proxy dns lookups. Proxy will return a public IP since it's not on the private network.
answered 8 months ago
Hey,
Hope you're keeping well.
On macOS, the AWS Client VPN DNS server you specify (like 10.0.0.2) may not always take precedence because the OS uses scutil and resolver rules per domain. Even though nslookup works, tools like kubectl and curl rely on the system resolver, which can prefer your default network DNS if the VPN client doesn’t push a per-domain route for *.eks.amazonaws.com. In the AWS Client VPN endpoint, make sure Enable DNS resolution is turned on and that your associated VPC has enableDnsHostnames enabled. You can also add a DNS server mapping in the VPN configuration or on macOS create a /etc/resolver/eks.amazonaws.com file pointing to 10.0.0.
Thanks and regards,
Taz
answered 8 months ago
Relevant content
asked a year ago
asked 2 years ago
- AWS OFFICIALUpdated a year ago
