Skip to content

Commit ba6aa12

Browse files
authored
Merge pull request #11 from jonathanio/feature/more-documentation
Improve Documentation
2 parents a08b311 + 9e4e5c5 commit ba6aa12

File tree

2 files changed

+137
-6
lines changed

2 files changed

+137
-6
lines changed

CHANGELOG.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
## 1.2.0 (2016.08.29)
2+
3+
NOTES:
4+
Add support for DNSSEC processing, improve logic around `DOMAIN` and
5+
`DOMAIN-SEARCH` handling, add support for `DOMAIN-ROUTE`, and improve
6+
documentation.
7+
8+
BACKWARDS INCOMPATIBILITIES:
9+
- Due to (probably) an incorrect assumption on my part (@jonathanio) in the
10+
purpose of `DOMAIN-SEARCH` verses `DOMAIN`, domains added via `DOMAIN` were
11+
marked as searchable, and so would be appended to bare domain names, while
12+
those added via `DOMAIN-SEARCH` would not. This was a divergance from how
13+
older OpenVPN handler scripts (such as `update-resolv-conf` and
14+
`update-systemd-network`) processed them (i.e. in all cases they were just
15+
made searchable). Note that both scripts didn't really have the concept of
16+
`domain` in the same way as `/etc/resolv.conf` understood it. This script now
17+
(hopefully) properly handles `DOMAIN` and `DOMAIN-SEARCH` (single of the
18+
former, and is primary, multiple of the latter and secondary).
19+
20+
FEATURES:
21+
- Add support for `DNSSEC` option which allows you to enable or disable (or
22+
leave to system default) the `DNSSEC` setting for any DNS queries made to the
23+
DNS servers provided for this link. (@jonathanio)
24+
- Add support for `DOMAIN-ROUTE` which, through `systemd-resolved`, allows you
25+
to set domain names which should be routed over this link to the DNS servers
26+
provided. (@jonathanio)
27+
28+
IMPROVEMENTS:
29+
- Correct the logic around the handling of `DOMAIN` and `DOMAIN-SEARCH` to be
30+
more compatible with previous versions of these handlers. (@jonathanio)
31+
32+
BUG FIXES:
33+
- None.
34+
35+
## 1.1.1 (2016.08.10)
36+
37+
NOTES:
38+
Thanks to the help from @pid1 for this release. The documentation mistakenly
39+
noted to use pre-down for the script now (compared to down originally, which
40+
failed as the tun or tap device would have been removed before the script
41+
ran). However, this should have in fact been down-pre.
42+
43+
FEATURES:
44+
- None.
45+
46+
IMPROVEMENTS:
47+
- None.
48+
49+
BUG FIXES:
50+
- Fix `pre-down` to `down-pre` in the documentation else you'll break your
51+
OpenVPN configuration. (@pid1)
52+
53+
## 1.1.0 (2016.08.08)
54+
55+
NOTES:
56+
Thanks to the work by @BaxterStockman, the script has been refactored, hopefully
57+
making it easier to read and follow, while additional tests around IPv6
58+
processing have been added.
59+
60+
FEATURES:
61+
- None.
62+
63+
IMPROVEMENTS:
64+
- Refactor the codebase to make it easier to read and expand. (@BaxterStockman)
65+
- Improve run-tests so multiple tests can be run within a file, and can expect
66+
failures within a test. (@BaxterStockman)
67+
- Add tests for invalid IPv6 addresses. (@BaxterStockman)
68+
69+
BUG FIXES:
70+
- None.
71+
72+
## 1.0.0 (2016.06.23)
73+
74+
NOTES:
75+
First release of `update-systemd-resolved`. Should fully support the three
76+
standard DHCP options in OpenVPN (`DNS`, `DOMAIN`, and `DOMAIN-SEARCH`) with
77+
integration tests around the code to manage and monitor regressions. Also
78+
supports multiple (and combined) IPv4 and IPv6 DNS addresses.

README.md

Lines changed: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ iproute2, and have at least version 229 of systemd, then it should work.
1616
Nonetheless, if you do come across problems, fork and fix, or raise an issue.
1717
All are most welcome.
1818

19-
# How to use?
19+
## How to Enable
2020

2121
Make sure that you have `systemd-resolved` enabled and running:
2222

@@ -29,22 +29,75 @@ Then update your `/etc/nsswitch.conf` file to look up DNS via the `resolve`
2929
service:
3030

3131
```
32-
# Use systemd-resolved first, then fall back to /etc/resolv.conf
33-
hosts: files resolve dns myhostname
3432
# Use /etc/resolv.conf first, then fall back to systemd-resolved
3533
hosts: files dns resolve myhostname
34+
# Use systemd-resolved first, then fall back to /etc/resolv.conf
35+
hosts: files resolve dns myhostname
36+
# Don't use /etc/resolv.conf at all
37+
hosts: files resolve myhostname
3638
```
3739

40+
*Note*: If you intend on using this script, the latter two are preferred
41+
otherwise the configuration provided by this script will only work on domains
42+
that cannot be resolved by the currently configured DNS servers (i.e. they must
43+
fall back after trying the ones set by your LAN's DHCP server).
44+
3845
Finally, update your OpenVPN configuration file and set the `up` and `down-pre`
3946
options:
4047

4148
```
4249
script-security 2
50+
setenv PATH /usr/bin
4351
up /etc/openvpn/update-systemd-resolved
4452
down-pre /etc/openvpn/update-systemd-resolved
4553
```
4654

47-
# How to help
55+
## Usage
56+
57+
`update-systemd-resolved` works by processing the `dhcp-option` commands set in
58+
OpenVPN, either through the server, or the client, configuration:
59+
60+
| Option | Examples | Notes |
61+
|--:|---|---|
62+
| `DNS` | `0.0.0.0`<br />`::1` | This sets the DNS servers for the link and can take any IPv4 or IPv6 address. |
63+
| `DOMAIN` | `example.com` | The primary domain for this host. If set multiple times, the last provided is used. Will be the primary search domain for bare hostnames. All requests for this domain as well will be routed to the `DNS` servers provided on this link. |
64+
| `DOMAIN-SEARCH` | `example.com` | Secondary domains which will be used to search for bare hostnames (after any `DOMAIN`, if set) and in the order provided. All requests for this domain will be routed to the `DNS` servers provided on this link. |
65+
| `DOMAIN-ROUTE` | `example.com` | All requests for these domains will be routed to the `DNS` servers provided on this link. They will *not* be used to search for bare hostnames, only routed. |
66+
| `DNSSEC` | `yes`<br />`no`</br >`default` | Control of DNSSEC should be enabled (`yes`) or disabled (`no`) for any queries over this link only, or use the system default (`default`). |
67+
68+
*Note*: There are no local or system options to be configured. All configuration
69+
for this script is handled though OpenVPN, including, for example, the name of
70+
the interface to be configured.
71+
72+
### Example
73+
74+
```
75+
push "dhcp-option DNS 10.62.3.2"
76+
push "dhcp-option DNS 10.62.3.3"
77+
push "dhcp-option DNS 2001:db8::a3:c15c:b56e:619a"
78+
push "dhcp-option DNS 2001:db8::a3:ffec:f61c:2e06"
79+
push "dhcp-option DOMAIN example.office"
80+
push "dhcp-option DOMAIN-SEARCH example.com"
81+
push "dhcp-option DOMAIN-ROUTE example.net"
82+
push "dhcp-option DOMAIN-ROUTE example.org"
83+
push "dhcp-option DNSSEC yes"
84+
```
85+
86+
This, added to the OpenVPN server's configuration file will set two IPv4 DNS
87+
servers and two IPv6 and will set the primary domain for the link to be
88+
`example.office`. Therefore if you try to look up the bare address `mail` then
89+
`mail.example.office` will be attempted first. The domain `example.com` is also
90+
added as an additional search domain, so if `mail.example.office` fails, then
91+
`mail.example.com` will be tried next.
92+
93+
Requests for `example.net` and `example.org` will also be routed though to the
94+
four DNS servers listed too, but they will *not* be appended (i.e.
95+
`mail.example.net` will not be attempted, nor `mail.example.org` if
96+
`mail.example.office` or `mail.example.com` do not exist).
97+
98+
Finally, DNSSEC has been enabled for this link (and this link only).
99+
100+
## How to help
48101

49102
If you can help with any of these areas, or have bug fixes, please fork and
50103
raise a Pull Request for me.
@@ -60,10 +113,10 @@ langauge.
60113
TravisCI is enabled on this repository: Click the link at the top of this README
61114
to see the current state of the code and its tests.
62115

63-
# Licence
116+
## Licence
64117

65118
GPL
66119

67-
# Author
120+
## Author
68121

69122
Jonathan Wright <[email protected]>

0 commit comments

Comments
 (0)