You are not logged in.

#1 2013-08-21 02:06:54

mixer
Member
Registered: 2013-08-16
Posts: 32

OpenVPN and DNS

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 8.8.8.8 8.8.4.4' | 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)

Offline

#2 2013-08-23 18:10:28

Divinorum
Member
Registered: 2011-08-16
Posts: 44

Re: OpenVPN and DNS

Check the write-attributes for /etc/resolv.conf with:

lsattr /etc/resolv.conf

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
https://wiki.archlinux.org/index.php/Resolv.conf

Offline

#3 2013-08-26 16:25:35

sidewinder46
Member
Registered: 2013-08-26
Posts: 1

Re: OpenVPN and DNS

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 208.67.222.222"  >> /etc/resolv.conf  # Sets OpenDNS
echo -e "nameserver 208.67.220.220"  >> /etc/resolv.conf
openvpn # Enter openvpn config file to start

Offline

#4 2013-08-28 01:56:27

mixer
Member
Registered: 2013-08-16
Posts: 32

Re: OpenVPN and DNS

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.

Offline

#5 2013-09-01 00:49:19

tdodz
Member
Registered: 2013-09-01
Posts: 1

Re: OpenVPN and DNS

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.

Offline

Board footer

Powered by FluxBB