I have setup an AWS EC2 instance (Ubuntu Server).
This is the content of /etc/resolv.conf
nameserver 127.0.0.53
options edns0
search ap-southeast-2.compute.internal
now I connect my EC2 instance to a VPN, using OpenVPN. OpenVPN make the following changes to /etc/resolv.conf
#
# Generated by OpenVPN 3 Linux (NetCfg::DNS::ResolvConfFile)
# Last updated: 2020-08-25 21:39:32
#
search somenetwork.com ap-southeast-2.compute.internal
# OpenVPN defined name servers
nameserver 121.98.0.1
nameserver 20.92.1.1
nameserver 20.92.1.2
nameserver 20.92.1.3
# System defined name servers
nameserver 127.0.0.53
# Other system settings
options edns0
After connecting to the VPN, my internet stops working. How can I resolve this issue?
Update:
As suggested in the comment by Thomas Ward, I connected to the VPN (which adds the above named server lines to resolv.conf) and then I am not able to browse the internet... but I can still ping 8.8.8.8. If I comment out the lines from resolv.conf then I can start browsing the internet.
I also tried the suggestion in the answer by Ravindra Bagale and ran the command:
ls -la /etc/resolv.conf
this is the output:
-rw-r--r-- 1 openvpn openvpn 244 Oct 10 05:05 /etc/resolv.conf
Check if your
/etc/resolv.conf
have symbolic link to/run/resolvconf/resolv.conf
Use below command to check
Sample output, if it has symbolic link:
Otherwise, delete or backup existing
/etc/resolv.conf
and then: