I have Openvpn client working, but not the DNS and resolvconf part.
I've followed the Openvpn wiki page and used the script (https://wiki.archlinux.org/index.php/OpenVPN#DNS). I added the bash "-x" flag to follow its execution. It runs but does nothing to my resolv.conf file.
I've also tried replacing the above script with a one liner hard coded for what my Openvpn server is sending back: "echo -n 'nameserver 22.214.171.124 126.96.36.199' | resolvconf -a tun0". It runs but no resolve.conf changes.
The only way I've gotten /etc/resolv.conf to update is after the Openvpn client is connected I manually run the above one line script in a bash shell outside of the openvpn client config file.
I'm running everything at root (for now). Thanks for any help.
Last edited by mixer (2013-08-21 12:40:55)
Check the write-attributes for /etc/resolv.conf with:
If the file is immutable (noted by an 'i' from the previous command) then the file will not be edited. Change the attribute and edit the file. Then change the attribute back to immutable to prevent automatic editing at boot.
Other possible culprits may listed in the this arch wiki page
I had the same problem, I just made a script to delete resolv.conf, rewrite it, and open openvpn. Run this to start OpenVpn, hope it helps:
#!/bin/bash rm -f /etc/resolv.conf echo -e "# Generated by resolvconf" >> /etc/resolv.conf echo -e "nameserver 188.8.131.52" >> /etc/resolv.conf # Sets OpenDNS echo -e "nameserver 184.108.40.206" >> /etc/resolv.conf openvpn # Enter openvpn config file to start
I appreciate the responses. I have been away from my Arch box and unable to investigate further. I'll will follow-up when I have time.
This is like the fourth issue with vpns and dns this week. Might be a bug somewhere, where the vpn is changing the /etc/resolv.conf incorrectly. I had an issue with OpenVpn messing up my dns. I had to use this response to fix my problem. Kind of a hack, but it worked for me.