Script that updates DNS settings are pushed by the OpenVPN server
Switch branches/tags
Nothing to show
Clone or download
masterkorp Merge pull request #27 from noraj1337/patch-1
Update description on how to launch script on the Arch Linux Install
Latest commit 43093c2 Jun 21, 2017

OpenVPN Update resolvconf


This is a script to update your /etc/resolv.conf with DNS settings that come from the received push dhcp-options. Since network management is out of OpenVPN client scope, this script adds and removes the provided from those settings.

This script was found on the OpenVPN page of the Archlinux Wiki

However if you have systemd 229 or newer the better option is to use script from which uses DBus calls instead of creating temporary *.network files.


Install openresolv

Place the script in /etc/openvpn/ or anywhere the OpenVPN client can acess.

Add the following lines to your client configuration:

# This updates the resolvconf with dns settings
setenv PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
script-security 2
up /etc/openvpn/
down /etc/openvpn/

Just start your openvpn client with the command you used to do.

Alternatively, if you don't want to edit your client configuration, you can add the following options to your openvpn command:

--setenv PATH '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' --script-security 2 --up /etc/openvpn/ --down /etc/openvpn/ --down-pre


For bugs and another questions open a ticket in the Isssues Page.

You can find me on and in last case mail me through the email that is on my Github Profile


Licenced under GNU GPL.


2016 - WGH Added modified script to support systemd-networkd

2014 - Alfredo Palhares

2013 - Fixed intet name

2006 -