Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alfredopalhares/openvpn-update-resolv-conf
Script that updates DNS settings are pushed by the OpenVPN server
https://github.com/alfredopalhares/openvpn-update-resolv-conf
Last synced: 5 days ago
JSON representation
Script that updates DNS settings are pushed by the OpenVPN server
- Host: GitHub
- URL: https://github.com/alfredopalhares/openvpn-update-resolv-conf
- Owner: alfredopalhares
- Created: 2014-06-27T16:52:30.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2022-03-25T11:08:22.000Z (over 2 years ago)
- Last Synced: 2024-08-02T12:50:35.363Z (3 months ago)
- Language: Shell
- Homepage:
- Size: 19.5 KB
- Stars: 459
- Watchers: 21
- Forks: 133
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-starred - alfredopalhares/openvpn-update-resolv-conf - Script that updates DNS settings are pushed by the OpenVPN server (others)
README
OpenVPN Update resolvconf
-------------------------### Description
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](https://wiki.archlinux.org/index.php/Openvpn#DNS)
However if you have systemd 229 or newer the better option is to use
script from https://github.com/jonathanio/update-systemd-resolved
which uses DBus calls instead of creating temporary *.network files.### Usage
Install [openresolv](http://roy.marples.name/projects/openresolv)
Place the script in ``/etc/openvpn/update-resolv-conf.sh`` 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/update-resolv-conf.sh
down /etc/openvpn/update-resolv-conf.sh
down-pre
```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/update-resolv-conf.sh --down /etc/openvpn/update-resolv-conf.sh --down-pre
```### Support
For bugs and another questions open a ticket in the [Isssues Page](https://github.com/masterkorp/openvpn-update-resolv-conf/issues).
You can find me on irc.freenode.org and in last case mail me through the email that is on my [Github Profile](https://github.com/masterkorp)
### License
Licenced under GNU GPL.
### Credits
2016 - WGH Added modified script to support systemd-networkd
2014 - Alfredo Palhares
2013 - [email protected] Fixed intet name
2006 - [email protected]