- Newest
- Most votes
- Most comments
This issue is related to how DNS queries are handled after establishing a VPN connection on Ubuntu systems. The problem occurs because the VPN connection is not overriding the default system nameserver, causing DNS queries to still go to your local DNS server (192.168.0.1) instead of using the AWS-provided nameservers.
To resolve this issue, you can try the following steps:
-
Modify the OpenVPN configuration file for your AWS Client VPN connection. You'll need to add the following directive:
dhcp-option DOMAIN-ROUTE .
This tells the system to route all DNS queries through the VPN tunnel.
-
Additionally, you may need to adjust how systemd-resolved handles DNS resolution. You can do this by creating a symlink for /etc/resolv.conf. Use one of these commands depending on your desired behavior:
For stub resolution: sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
For full DNS resolution through systemd-resolved: sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
-
If you're using the OpenVPN command line client, ensure that you have the resolvconf package installed and add the following lines to your OpenVPN configuration file:
script-security 2 up /etc/openvpn/update-resolv-conf down /etc/openvpn/update-resolv-conf
These changes should help ensure that DNS queries are properly routed through the VPN tunnel and that the AWS-provided nameservers are used first. After making these changes, reconnect to the VPN and check if the RDS instance can be resolved correctly.
If you continue to experience issues, you may need to consult with your network administrator or AWS support for further assistance, as there could be specific configurations in your environment that need to be addressed.
Sources
Troubleshooting AWS Client VPN connections with Linux-based clients - AWS Client VPN
Relevant content
- asked 3 years ago
- asked 3 years ago
- asked a year ago