Skip to content

Commit 35bd0a7

Browse files
committed
OpenBSD - Updated and simplified instructions
1 parent b8b3792 commit 35bd0a7

File tree

2 files changed

+16
-27
lines changed

2 files changed

+16
-27
lines changed

docs/en/Setup_Guides/Linux_and_BSD/FreeBSD_(Encrypted).md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ Original /etc/resolv.conf saved as /var/backups/resolv.conf.20220625.200835
7373
```
7474
## Instructions
7575

76-
* Configuring local_unbound for DNS over TLS to Quad9
77-
7876
This command will back up the default configuration files, download the modified config files from the attachment of this article, and restart the local_unbound service.
7977

8078
```

docs/en/Setup_Guides/Linux_and_BSD/OpenBSD_(Encrypted).md

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This article describes how to configure and use Unbound on OpenBSD in order to send encrypted DNS via DNS over TLS to Quad9.
44

5-
This was tested using OpenBSD 7.1.
5+
This was tested using OpenBSD 7.7.
66

77
!!! warning "Firefox, VPNs"
88
* **Firefox** is set to use Cloudflare DNS by default in some regions. If you're using Firefox, check that [this is disabled](https://support.mozilla.org/en-US/kb/dns-over-https#w_configure-doh-protection-settings).
@@ -42,47 +42,38 @@ forward-addr: 2620:fe::fe@853#dns.quad9.net
4242
forward-addr: 2620:fe::9@853#dns.quad9.net
4343
```
4444

45-
* Set Unbound to start on system startup, and enable the service (run these commands one at a time):
45+
* Set Unbound to start on system startup, and start the service:
4646

4747
```
48-
rcctl enable unbound
49-
```
50-
```
51-
rcctl start unbound
48+
rcctl enable unbound && rcctl start unbound
5249
```
5350

54-
## Verify Configuration
51+
* Disable resolvd to prevent automatically overriding the `/etc/resolv.conf` file:
5552

56-
Open a separate/second Terminal session to the OpenBSD system as the root user and start a packet capture, filtering for port 853 (DNS over TLS port):
57-
tcpdump -n 'port 853'
58-
59-
* On your first Terminal session, make sure Unbound can answer DNS queries:
60-
dig +short quad9.net @127.0.0.1
53+
```
54+
rcctl disable resolvd && rcctl stop resolvd
55+
```
6156

62-
The result should be: 216.21.3.77
57+
* Set your system to start using Unbound for DNS by backing up the existing resolv.conf file and set 127.0.0.1 as the DNS server for the system:
6358

64-
On your second Terminal session, tcpdump should show output like this, which confirms that the DNS query was sent to Quad9 with DNS over TLS:
6559
```
66-
tcpdump: listening on em0, link-type EN10MB
67-
00:29:08.307240 192.168.1.194.42064 > 149.112.112.112.853: S 3620809840:3620809840(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 6,nop,nop,timestamp 495425124 0> (DF)
68-
00:29:08.313467 149.112.112.112.853 > 192.168.1.194.42064: S 1684627303:1684627303(0) ack 3620809841 win 28960 <mss 1460,nop,nop,timestamp 3541989193 495425124,nop,wscale 8> (DF)
69-
00:29:08.313559 192.168.1.194.42064 > 149.112.112.112.853: . ack 1 win 256 <nop,nop,timestamp 495425124 3541989193> (DF)
70-
00:29:08.313895 192.168.1.194.42064 > 149.112.112.112.853: P 1:310(309) ack 1 win 256 <nop,nop,timestamp 495425124 3541989193> (DF)
71-
00:29:08.319973 149.112.112.112.853 > 192.168.1.194.42064: . ack 310 win 118 <nop,nop,timestamp 3541989200 495425124> (DF)
72-
00:29:08.320719 149.112.112.112.853 > 192.168.1.194.42064: . 1:1449(1448) ack 310 win 118
60+
mv /etc/resolv.conf /etc/resolv.BAK && echo "nameserver 127.0.0.1" > /etc/resolv.conf
7361
```
7462

75-
Set your system to start using Unbound for DNS by backing up the existing resolv.conf file and set 127.0.0.1 as the DNS server for the system:
63+
## Verify Configuration
64+
65+
Using the [Quad9 Protocol test](https://docs.quad9.net/FAQs/#protocol-test-confirm-on-which-protocol-quad9-received-your-query), the result should be `dot.`, which indicates your queries are being sent to Quad9 and are encrypted with DNS over TLS:
66+
7667
```
77-
cp /etc/resolv.conf /etc/resolv.BAK && echo "nameserver 127.0.0.1" > /etc/resolv.conf
68+
dig +short txt proto.on.quad9.net.
7869
```
7970

8071
## Undo
8172

82-
If you want to stop using Unbound as the DNS server, simply restore the backed-up resolv.conf file:
73+
If you want to stop using Unbound as the DNS server and revert these changes, simply re-enable/start resolvd:
8374

8475
```
85-
mv /etc/resolv.BAK /etc/resolv.conf
76+
rcctl enable resolvd && rcctl start resolvd
8677
```
8778

8879
Questions? Issues? Didn't work? Contact us!

0 commit comments

Comments
 (0)